diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..032ba48 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,17 @@ +GEM + remote: http://rubygems.org/ + specs: + rack (1.3.5) + rack-protection (1.1.4) + rack + sinatra (1.3.1) + rack (~> 1.3, >= 1.3.4) + rack-protection (~> 1.1, >= 1.1.2) + tilt (~> 1.3, >= 1.3.3) + tilt (1.3.3) + +PLATFORMS + ruby + +DEPENDENCIES + sinatra diff --git a/README.mdown b/README.mdown index f6a4c64..d164aa5 100644 --- a/README.mdown +++ b/README.mdown @@ -1,3 +1,18 @@ +# Ruby version of Pattern-Primer by adactio + +See https://github.com/adactio/Pattern-Primer + +## Pattern Primer + Create little snippets of markup and save them to the "patterns folder." The pattern primer will generate a list of all the patterns in that folder. You will see the pattern rendered as HTML. You will also get the source displayed in a textarea. -You should be able to take the whole "pattern-primer" folder and drop it into your own project (assuming you're running PHP) **BUT** make sure to update the link element in the head of pattern-primer/index.php to point to your own CSS. \ No newline at end of file +## How it works + +1. Clone the repo +2. run bundle install +3. Copy your CSS to public/style.css +4. Run the file with 'ruby application.rb' or 'shotgun' if you have the shotgun gem installed (https://github.com/rtomayko/shotgun) + +## Acknowledgements + +Thanks to @adactio diff --git a/application.rb b/application.rb new file mode 100644 index 0000000..8c4dfc5 --- /dev/null +++ b/application.rb @@ -0,0 +1,6 @@ +require 'sinatra' +set :public_folder, File.dirname(__FILE__) + '/public' + +get '/' do + erb :index +end \ No newline at end of file diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..5b19071 --- /dev/null +++ b/config.ru @@ -0,0 +1,7 @@ +require 'rubygems' +require 'bundler/setup' +require 'sinatra' + +require './application' + +run Sinatra::Application \ No newline at end of file diff --git a/gemfile b/gemfile new file mode 100644 index 0000000..79c5baf --- /dev/null +++ b/gemfile @@ -0,0 +1,2 @@ +source :rubygems +gem 'sinatra' \ No newline at end of file diff --git a/index.php b/index.php deleted file mode 100644 index 42621e9..0000000 --- a/index.php +++ /dev/null @@ -1,51 +0,0 @@ - -
- -