vanilla 1.16 → 1.16.1

Sign up to get free protection for your applications and to get access to all the features.
data/bin/vanilla CHANGED
@@ -12,26 +12,48 @@ def create(new_app_dir)
12
12
  puts File.readlines(File.join(new_app_dir, "README"))[0..16].join
13
13
  end
14
14
 
15
+ def upgrade
16
+ require 'fileutils'
17
+ confirm("Upgrade system snips?") do
18
+ pristine_system = File.expand_path("../../pristine_app/soups/system", __FILE__)
19
+ copy(pristine_system, File.join(Dir.pwd, "soups"))
20
+ end
21
+ confirm("Upgrade tutorial snips?") do
22
+ pristine_system = File.expand_path("../../pristine_app/soups/tutorial", __FILE__)
23
+ copy(pristine_system, File.join(Dir.pwd, "soups"))
24
+ end
25
+ end
26
+
27
+ def confirm(message)
28
+ print(message + " [y/n]: ")
29
+ if gets.strip =~ /^[yY]$/
30
+ yield
31
+ else
32
+ puts "skipping."
33
+ end
34
+ end
35
+
36
+ def copy(source, destination)
37
+ puts "Copying: #{source} => #{destination}"
38
+ FileUtils.cp_r(source, destination)
39
+ end
40
+
15
41
  def console
16
42
  $LOAD_PATH << "lib"
17
43
  require "rubygems"
18
44
  require "bundler/setup"
19
45
  require "irb"
20
46
  require "vanilla/console"
21
- ARGV.clear
22
47
  puts "The Soup is simmering."
23
48
  IRB.start
24
49
  end
25
50
 
26
- def upgrade
27
- # TODO
28
- puts "TODO, but should be easier thanks to multi-space soup."
29
- end
30
-
31
51
  case ARGV[0]
32
52
  when "console"
53
+ ARGV.clear
33
54
  console
34
55
  when "upgrade"
56
+ ARGV.clear
35
57
  upgrade
36
58
  else
37
59
  create(ARGV[0])
data/lib/vanilla.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Vanilla
2
- VERSION = "1.16"
2
+ VERSION = "1.16.1"
3
3
 
4
4
  autoload :Renderers, "vanilla/renderers"
5
5
  autoload :App, "vanilla/app"
@@ -26,7 +26,7 @@ module Vanilla
26
26
  end
27
27
 
28
28
  def self.snip_regexp
29
- %r{(\{[\w\-_\d\.\"\'\s]+(\s+[^\}.]+)?\})}
29
+ %r{(\{[\w\-_\d\.\"\' ]+( +[^\}.]+)?\})}
30
30
  end
31
31
 
32
32
  def default_layout_snip
@@ -1,29 +1,29 @@
1
1
  PATH
2
2
  remote: /Users/james/Code/lazyatom/vanilla-rb
3
3
  specs:
4
- vanilla (1.14.1)
4
+ vanilla (1.16)
5
5
  BlueCloth (>= 1.0.0)
6
6
  RedCloth (>= 4.1.1)
7
7
  haml
8
+ parslet (>= 1.2.0)
8
9
  rack (>= 0.9.1)
9
10
  ratom (>= 0.3.5)
10
11
  soup (>= 1.0.6)
11
- treetop (>= 1.4.1)
12
12
 
13
13
  GEM
14
14
  remote: http://rubygems.org/
15
15
  specs:
16
16
  BlueCloth (1.0.1)
17
17
  RedCloth (4.2.7)
18
+ blankslate (2.1.2.4)
18
19
  haml (3.1.1)
19
- libxml-ruby (2.0.2)
20
- polyglot (0.3.1)
20
+ libxml-ruby (2.0.4)
21
+ parslet (1.2.0)
22
+ blankslate (~> 2.0)
21
23
  rack (1.2.2)
22
- ratom (0.6.7)
24
+ ratom (0.6.8)
23
25
  libxml-ruby (>= 1.1.2)
24
26
  soup (1.0.6)
25
- treetop (1.4.9)
26
- polyglot (>= 0.3.1)
27
27
 
28
28
  PLATFORMS
29
29
  ruby
@@ -8,7 +8,7 @@ require 'vanilla'
8
8
  # doesn't affect their URL structure on the site (everything is flat).
9
9
  soups = [
10
10
  "soups/base",
11
- "soups/dynasnips"
11
+ "soups/system"
12
12
  ]
13
13
 
14
14
  # If you don't want the tutorial on your site, remove this and delete the directory
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- {link_to tutorial}
2
- {link_to tutorial-layout}
3
- {link_to tutorial-renderers}
4
- {link_to tutorial-dynasnips}
1
+ {link_to tutorial, "Basics"}
2
+ {link_to tutorial-layout, "Learn about Layouts"}
3
+ {link_to tutorial-renderers, "Renderer fun"}
4
+ {link_to tutorial-dynasnips, "More about Dynasnips"}
@@ -9,7 +9,7 @@ In its simplest form, this means that some content can be written in one format
9
9
 
10
10
  This is one of the principle drivers behind {link_to vanilla-rb}; you shouldn't have to make an upfront decision about how best to structure your all of your content.
11
11
 
12
- This has been covered generally in the {link_to tutorial, main tutorial}, but here we'll go into a bit more detail.
12
+ This has been covered generally in the {link_to tutorial, "main tutorial"}, but here we'll go into a bit more detail.
13
13
 
14
14
  Defining a renderer for a snip
15
15
  -------------------
File without changes
@@ -1,5 +1,5 @@
1
1
  require "test_helper"
2
- $LOAD_PATH.unshift File.expand_path("../../../pristine_app/soups/dynasnips", __FILE__)
2
+ $LOAD_PATH.unshift File.expand_path("../../../pristine_app/soups/system", __FILE__)
3
3
  require "link_to_current_snip"
4
4
 
5
5
  context "The link_to_current_snip dynasnip" do
@@ -1,5 +1,5 @@
1
1
  require "test_helper"
2
- $LOAD_PATH.unshift File.expand_path("../../../pristine_app/soups/dynasnips", __FILE__)
2
+ $LOAD_PATH.unshift File.expand_path("../../../pristine_app/soups/system", __FILE__)
3
3
  require "link_to"
4
4
 
5
5
  context "The link_to dynasnip" do
@@ -1,5 +1,5 @@
1
1
  require "test_helper"
2
- $LOAD_PATH.unshift File.expand_path("../../../pristine_app/soups/dynasnips", __FILE__)
2
+ $LOAD_PATH.unshift File.expand_path("../../../pristine_app/soups/system", __FILE__)
3
3
  require "page_title"
4
4
 
5
5
  context "The page_title dynasnip" do
@@ -49,6 +49,10 @@ context "When including snips in other snips" do
49
49
  assert_equal "10.times {|x| puts x }", render("10.times {|x| puts x }")
50
50
  end
51
51
 
52
+ should "ignore references that contain newlines" do
53
+ assert_equal "{\nnot a dyna\n}", render("{\nnot a dyna\n}")
54
+ end
55
+
52
56
  def render(content)
53
57
  snip = create_snip :name => "test-content", :content => content
54
58
  Vanilla::Renderers::Base.new(@app).render(snip)
data/test/test_helper.rb CHANGED
@@ -14,7 +14,7 @@ module Vanilla
14
14
  clean_environment
15
15
  @app = Vanilla::App.new(:soup => soup_path)
16
16
 
17
- require File.expand_path("../../pristine_app/soups/dynasnips/current_snip", __FILE__)
17
+ require File.expand_path("../../pristine_app/soups/system/current_snip", __FILE__)
18
18
  @app.soup << CurrentSnip.snip_attributes
19
19
  create_snip :name => "layout", :content => "{current_snip}"
20
20
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vanilla
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 85
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 16
9
- version: "1.16"
9
+ - 1
10
+ version: 1.16.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - James Adam
@@ -209,18 +210,18 @@ files:
209
210
  - pristine_app/README
210
211
  - pristine_app/soups/base/layout.snip
211
212
  - pristine_app/soups/base/start.snip
212
- - pristine_app/soups/dynasnips/current_snip.rb
213
- - pristine_app/soups/dynasnips/debug.rb
214
- - pristine_app/soups/dynasnips/index.rb
215
- - pristine_app/soups/dynasnips/link_to.rb
216
- - pristine_app/soups/dynasnips/link_to_current_snip.rb
217
- - pristine_app/soups/dynasnips/page_title.rb
218
- - pristine_app/soups/dynasnips/pre.rb
219
- - pristine_app/soups/dynasnips/raw.rb
220
213
  - pristine_app/soups/extras/comments.rb
221
214
  - pristine_app/soups/extras/kind.rb
222
215
  - pristine_app/soups/extras/rand.rb
223
216
  - pristine_app/soups/extras/url_to.rb
217
+ - pristine_app/soups/system/current_snip.rb
218
+ - pristine_app/soups/system/debug.rb
219
+ - pristine_app/soups/system/index.rb
220
+ - pristine_app/soups/system/link_to.rb
221
+ - pristine_app/soups/system/link_to_current_snip.rb
222
+ - pristine_app/soups/system/page_title.rb
223
+ - pristine_app/soups/system/pre.rb
224
+ - pristine_app/soups/system/raw.rb
224
225
  - pristine_app/soups/tutorial/bad_dynasnip.snip
225
226
  - pristine_app/soups/tutorial/hello_world.snip
226
227
  - pristine_app/soups/tutorial/markdown_example.snip
@@ -237,6 +238,7 @@ files:
237
238
  - pristine_app/soups/tutorial/tutorial.snip.markdown
238
239
  - pristine_app/soups/tutorial/vanilla-rb.snip
239
240
  - pristine_app/soups/tutorial/vanilla.snip
241
+ - pristine_app/tmp/restart.txt
240
242
  has_rdoc: true
241
243
  homepage: http://github.com/lazyatom/vanilla-rb
242
244
  licenses: []