wallpapering-rails 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ vendor/bundle
@@ -1,5 +1,5 @@
1
1
  module Wallpapering
2
2
  module Rails
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -2,6 +2,16 @@ require "wallpapering"
2
2
  require "wallpapering-rails/version"
3
3
 
4
4
  module Wallpapering
5
+ class Decorator
6
+ include ActionView::Helpers::UrlHelper
7
+
8
+ private
9
+
10
+ def urls
11
+ ::Rails.application.routes.url_helpers
12
+ end
13
+ end
14
+
5
15
  module Rails
6
16
  end
7
17
  end
@@ -0,0 +1,26 @@
1
+ require 'rails/all'
2
+ require 'wallpapering-rails'
3
+
4
+ module Wallpapering
5
+
6
+ describe Decorator do
7
+ let(:decorator){ Decorator.new(decoratable) }
8
+ let(:decoratable){ Object.new }
9
+
10
+ let(:url_routes_helper){ double }
11
+
12
+ it "includes ActionView URL Helpers" do
13
+ expect(decorator.singleton_class.ancestors).
14
+ to include(ActionView::Helpers::UrlHelper)
15
+ end
16
+
17
+ it "delegates routing helpers to the host application" do
18
+ ::Rails.stub_chain(:application, :routes, :url_helpers).
19
+ and_return(url_routes_helper)
20
+
21
+ url_routes_helper.should_receive(:posts_path)
22
+
23
+ decorator.send(:urls).posts_path
24
+ end
25
+ end
26
+ end
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
 
20
20
  gem.add_dependency "wallpapering", "~> 0.0.2"
21
- gem.add_dependency "rails"
21
+ gem.add_dependency "rails", "~> 3.0"
22
22
  gem.add_development_dependency "rspec"
23
23
  gem.add_development_dependency "generator_spec"
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wallpapering-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-19 00:00:00.000000000 Z
12
+ date: 2013-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: wallpapering
@@ -32,17 +32,17 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: '0'
37
+ version: '3.0'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: '0'
45
+ version: '3.0'
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: rspec
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -93,6 +93,7 @@ files:
93
93
  - lib/wallpapering-rails.rb
94
94
  - lib/wallpapering-rails/version.rb
95
95
  - spec/lib/generators/wallpapering-rails/decorator_generator_spec.rb
96
+ - spec/lib/wallpapering-rails_spec.rb
96
97
  - wallpapering-rails.gemspec
97
98
  homepage: http://github.com/eightbitraptor/wallpapering-rails
98
99
  licenses: []
@@ -114,9 +115,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
115
  version: '0'
115
116
  requirements: []
116
117
  rubyforge_project:
117
- rubygems_version: 1.8.24
118
+ rubygems_version: 1.8.23
118
119
  signing_key:
119
120
  specification_version: 3
120
121
  summary: wraps the wallpapering gem for Rails
121
122
  test_files:
122
123
  - spec/lib/generators/wallpapering-rails/decorator_generator_spec.rb
124
+ - spec/lib/wallpapering-rails_spec.rb