radiant-snippets-extension 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module RadiantSnippetsExtension
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  SUMMARY = "Snippets for Radiant CMS"
4
4
  DESCRIPTION = "Makes Radiant better by adding snippets!"
5
5
  URL = "http://github.com/radiant"
@@ -7,7 +7,7 @@ then
7
7
  fi
8
8
  cp -r ~/builds/*/radiant-snippets-extension vendor/extensions/snippets
9
9
  gem install bundler --pre
10
- echo 'gem "radiant-snippets-extension", :path => "vendor/extensions/snippets"' >> Gemfile
10
+ echo gemspec >> Gemfile
11
11
  bundle install
12
12
 
13
13
  case $DB in
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + "/../../spec_helper"
1
+ require 'snippets_spec_helper'
2
2
 
3
3
  describe Admin::SnippetsController do
4
4
  dataset :users, :snippets
@@ -1,9 +1,15 @@
1
+ class SnippetMarkdownFilter < TextFilter
2
+ def filter(text)
3
+ text + ' for Snippets!'
4
+ end
5
+ end
6
+
1
7
  class SnippetsDataset < Dataset::Base
2
8
 
3
9
  def load
4
10
  create_snippet "first", :content => "test"
5
11
  create_snippet "another", :content => "another test"
6
- create_snippet "markdown", :filter_id => "Markdown", :content => "**markdown**"
12
+ create_snippet "markdown", :filter_id => "Snippet Markdown", :content => "**markdown**"
7
13
  create_snippet "radius", :content => "<r:title />"
8
14
  create_snippet "global_page_cascade", :content => "<r:children:each><r:page:title /> </r:children:each>"
9
15
  create_snippet "recursive", :content => "<r:children:each><r:snippet name='recursive' /></r:children:each><r:title />"
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + "/../../spec_helper"
1
+ require 'snippets_spec_helper'
2
2
 
3
3
  describe Radiant::AdminUI do
4
4
  let(:admin) do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require 'snippets_spec_helper'
2
2
 
3
3
  describe "Page rendering snippets" do
4
4
  dataset :pages, :snippets
@@ -12,7 +12,7 @@ describe "Page rendering snippets" do
12
12
  end
13
13
 
14
14
  it 'should render a snippet with a filter' do
15
- page.render_snippet(snippets(:markdown)).should match(%r{<p><strong>markdown</strong></p>})
15
+ page.render_snippet(snippets(:markdown)).should include(%{**markdown** for Snippets!})
16
16
  end
17
17
 
18
18
  it 'should render a snippet with a tag' do
@@ -33,11 +33,12 @@ describe "Page rendering snippets" do
33
33
  end
34
34
 
35
35
  it "should filter the snippet with its assigned filter" do
36
- page.should render('<r:page><r:snippet name="markdown" /></r:page>').matching(%r{<p><strong>markdown</strong></p>})
36
+ page.should render('<r:page><r:snippet name="markdown" /></r:page>').matching(Regexp.new(Regexp.quote('**markdown** for Snippets!')))
37
37
  end
38
38
 
39
39
  it "should maintain the global page inside the snippet" do
40
- pages(:parent).should render('<r:snippet name="global_page_cascade" />').as("#{page.title} " * page.children.count)
40
+ parent_page = pages(:parent)
41
+ parent_page.should render('<r:snippet name="global_page_cascade" />').as("#{parent_page.title} " * parent_page.children.count)
41
42
  end
42
43
 
43
44
  it "should maintain the global page when the snippet renders recursively" do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require 'snippets_spec_helper'
2
2
 
3
3
  describe Snippet do
4
4
  dataset :snippets
@@ -14,14 +14,14 @@ describe Snippet do
14
14
  end
15
15
 
16
16
  it "should take the filter from the default filter" do
17
- Radiant::Config['defaults.snippet.filter'] = "Textile"
17
+ Radiant::Config.should_receive(:[]).with("defaults.snippet.filter").and_return('Textile')
18
18
  snippet = Snippet.new :name => 'new-snippet'
19
19
  snippet.filter_id.should == "Textile"
20
20
  end
21
21
 
22
22
  it "shouldn't override existing snippets filters with the default filter" do
23
23
  snippet = Snippet.find(:first, :conditions => {:filter_id => nil})
24
- Radiant::Config['defaults.snippet.filter'] = "Textile"
24
+ Radiant::Config.stub!(:[]).with("defaults.snippet.filter").and_return('Textile')
25
25
  snippet.reload
26
26
  snippet.filter_id.should_not == "Textile"
27
27
  end
@@ -54,6 +54,6 @@ describe Snippet do
54
54
 
55
55
  it 'should allow the filter to be specified' do
56
56
  @snippet = snippets(:markdown)
57
- @snippet.filter.should be_kind_of(MarkdownFilter)
57
+ @snippet.filter.should be_kind_of(SnippetMarkdownFilter)
58
58
  end
59
59
  end
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require 'snippets_spec_helper'
2
2
 
3
3
  describe UserActionObserver do
4
4
  dataset :users, :pages_with_layouts, :snippets
@@ -9,11 +9,8 @@ describe UserActionObserver do
9
9
  end
10
10
 
11
11
  it 'should observe create' do
12
- [
13
- Snippet.create!(snippet_params)
14
- ].each do |model|
15
- model.created_by.should == @user
16
- end
12
+ snippet = Snippet.create!(snippet_params)
13
+ snippet.created_by.should == @user
17
14
  end
18
15
 
19
16
  it 'should observe update' do
File without changes
metadata CHANGED
@@ -1,104 +1,96 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: radiant-snippets-extension
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
4
5
  prerelease:
5
- version: 1.0.0
6
6
  platform: ruby
7
- authors:
8
- - Jim Gay
7
+ authors:
8
+ - Jim Gay
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-03-05 00:00:00 Z
12
+ date: 2012-03-06 00:00:00.000000000 Z
14
13
  dependencies: []
15
-
16
14
  description: Makes Radiant better by adding snippets!
17
- email:
18
- - radiant@radiantcms.org
15
+ email:
16
+ - radiant@radiantcms.org
19
17
  executables: []
20
-
21
18
  extensions: []
22
-
23
19
  extra_rdoc_files: []
24
-
25
- files:
26
- - cucumber.yml
27
- - radiant-snippets-extension.gemspec
28
- - Rakefile
29
- - README.md
30
- - snippets_extension.rb
31
- - app/controllers/admin/snippets_controller.rb
32
- - app/helpers/admin/snippets_helper.rb
33
- - app/models/snippet.rb
34
- - app/views/admin/snippets/_form.html.haml
35
- - app/views/admin/snippets/edit.html.haml
36
- - app/views/admin/snippets/index.html.haml
37
- - app/views/admin/snippets/new.html.haml
38
- - app/views/admin/snippets/remove.html.haml
39
- - config/routes.rb
40
- - config/initializers/radiant_config.rb
41
- - config/locales/en.yml
42
- - features/admin/configuration.feature
43
- - features/admin/pagination.feature
44
- - features/admin/snippets_management.feature
45
- - features/step_definitions/admin/snippet_steps.rb
46
- - features/support/env.rb
47
- - features/support/paths.rb
48
- - lib/radiant-snippets-extension.rb
49
- - lib/snippet_tags.rb
50
- - lib/tasks/snippets_extension_tasks.rake
51
- - spec/spec.opts
52
- - spec/spec_helper.rb
53
- - spec/ci/before_script
54
- - spec/ci/script
55
- - spec/controllers/admin/snippets_controller_spec.rb
56
- - spec/datasets/snippets_dataset.rb
57
- - spec/lib/radiant/admin_ui_spec.rb
58
- - spec/models/page_spec.rb
59
- - spec/models/snippet_spec.rb
60
- - spec/models/user_action_observer_spec.rb
20
+ files:
21
+ - app/controllers/admin/snippets_controller.rb
22
+ - app/helpers/admin/snippets_helper.rb
23
+ - app/models/snippet.rb
24
+ - app/views/admin/snippets/_form.html.haml
25
+ - app/views/admin/snippets/edit.html.haml
26
+ - app/views/admin/snippets/index.html.haml
27
+ - app/views/admin/snippets/new.html.haml
28
+ - app/views/admin/snippets/remove.html.haml
29
+ - config/initializers/radiant_config.rb
30
+ - config/locales/en.yml
31
+ - config/routes.rb
32
+ - cucumber.yml
33
+ - features/admin/configuration.feature
34
+ - features/admin/pagination.feature
35
+ - features/admin/snippets_management.feature
36
+ - features/step_definitions/admin/snippet_steps.rb
37
+ - features/support/env.rb
38
+ - features/support/paths.rb
39
+ - lib/radiant-snippets-extension.rb
40
+ - lib/snippet_tags.rb
41
+ - lib/tasks/snippets_extension_tasks.rake
42
+ - radiant-snippets-extension.gemspec
43
+ - Rakefile
44
+ - README.md
45
+ - snippets_extension.rb
46
+ - spec/ci/before_script
47
+ - spec/ci/script
48
+ - spec/controllers/admin/snippets_controller_spec.rb
49
+ - spec/datasets/snippets_dataset.rb
50
+ - spec/lib/radiant/admin_ui_spec.rb
51
+ - spec/models/page_spec.rb
52
+ - spec/models/snippet_spec.rb
53
+ - spec/models/user_action_observer_spec.rb
54
+ - spec/snippets_spec_helper.rb
55
+ - spec/spec.opts
61
56
  homepage: http://github.com/radiant
62
57
  licenses: []
63
-
64
58
  post_install_message:
65
59
  rdoc_options: []
66
-
67
- require_paths:
68
- - lib
69
- required_ruby_version: !ruby/object:Gem::Requirement
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
70
63
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: "0"
75
- required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
69
  none: false
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: "0"
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
81
74
  requirements: []
82
-
83
75
  rubyforge_project:
84
- rubygems_version: 1.8.9
76
+ rubygems_version: 1.8.11
85
77
  signing_key:
86
78
  specification_version: 3
87
79
  summary: Snippets for Radiant CMS
88
- test_files:
89
- - spec/spec.opts
90
- - spec/spec_helper.rb
91
- - spec/ci/before_script
92
- - spec/ci/script
93
- - spec/controllers/admin/snippets_controller_spec.rb
94
- - spec/datasets/snippets_dataset.rb
95
- - spec/lib/radiant/admin_ui_spec.rb
96
- - spec/models/page_spec.rb
97
- - spec/models/snippet_spec.rb
98
- - spec/models/user_action_observer_spec.rb
99
- - features/admin/configuration.feature
100
- - features/admin/pagination.feature
101
- - features/admin/snippets_management.feature
102
- - features/step_definitions/admin/snippet_steps.rb
103
- - features/support/env.rb
104
- - features/support/paths.rb
80
+ test_files:
81
+ - spec/ci/before_script
82
+ - spec/ci/script
83
+ - spec/controllers/admin/snippets_controller_spec.rb
84
+ - spec/datasets/snippets_dataset.rb
85
+ - spec/lib/radiant/admin_ui_spec.rb
86
+ - spec/models/page_spec.rb
87
+ - spec/models/snippet_spec.rb
88
+ - spec/models/user_action_observer_spec.rb
89
+ - spec/snippets_spec_helper.rb
90
+ - spec/spec.opts
91
+ - features/admin/configuration.feature
92
+ - features/admin/pagination.feature
93
+ - features/admin/snippets_management.feature
94
+ - features/step_definitions/admin/snippet_steps.rb
95
+ - features/support/env.rb
96
+ - features/support/paths.rb