neo-rails 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +4 -1
- data/Gemfile +12 -0
- data/README.md +15 -1
- data/lib/neo/rails/exposure.rb +1 -1
- data/lib/neo/rails/presenter/test_helper.rb +6 -2
- data/lib/neo/rails/version.rb +1 -1
- data/neo-rails.gemspec +0 -1
- data/test/exposure_test.rb +16 -4
- metadata +15 -42
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 84525b58befbfb522097938b890e54b058751b3e
|
4
|
+
data.tar.gz: a34f4002f35f2491abd3c9330eb43153b9f26fa8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 66b5bd3ca915cf83f481959db8f5049b7bde59bae1342ef7b10901379c9e4b093c669e0b2e330d51aff5eb67203aa653375f803bc96a5c5406fb7cbd006d1848
|
7
|
+
data.tar.gz: ca6609c1b36dfadefbe1c60365ca64ffc3b9b28c5e33fc3fdc92811aebf6790bc96356cce76266b4e6ce79978bfe422dcc22dc8ee830174cc05054c2d10276e7
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -2,3 +2,15 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in neo-rails.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
rails_version = ENV['RAILS_VERSION']
|
7
|
+
case rails_version
|
8
|
+
when '4.0'
|
9
|
+
gem 'rails', '4.0.0.beta1'
|
10
|
+
when '3.2'
|
11
|
+
gem 'rails', '~> 3.2.13'
|
12
|
+
when NilClass
|
13
|
+
abort "Missing env RAILS_VERSION"
|
14
|
+
else
|
15
|
+
abort "Rails version #{rails_version.inspect} not supported"
|
16
|
+
end
|
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
# Neo::Rails
|
1
|
+
# Neo::Rails
|
2
|
+
|
3
|
+
[![Build Status](https://secure.travis-ci.org/neopoly/neo-rails.png?branch=master)](http://travis-ci.org/neopoly/neo-rails) [![Gem Version](https://badge.fury.io/rb/neo-rails.png)](http://badge.fury.io/rb/neo-rails) [![Code Climate](https://codeclimate.com/github/neopoly/neo-rails.png)](https://codeclimate.com/github/neopoly/neo-rails)
|
4
|
+
|
2
5
|
`neo-rails` contains some tools helping us doing Rails.
|
3
6
|
|
4
7
|
This gem includes:
|
@@ -73,6 +76,17 @@ In app/layouts/application.html.erb
|
|
73
76
|
|
74
77
|
<%= render_scenarios_list %>
|
75
78
|
|
79
|
+
### Testing
|
80
|
+
|
81
|
+
rm -f Gemfile.lock
|
82
|
+
export RAILS_VERSION=3.2 # or 4.0
|
83
|
+
bundle
|
84
|
+
bundle exec rake
|
85
|
+
|
86
|
+
## TODO
|
87
|
+
|
88
|
+
* Test scenarios!
|
89
|
+
|
76
90
|
## Contributing
|
77
91
|
|
78
92
|
1. Fork it
|
data/lib/neo/rails/exposure.rb
CHANGED
@@ -13,8 +13,12 @@ module Neo
|
|
13
13
|
include ActionView::Helpers::UrlHelper
|
14
14
|
include ActionView::Helpers::TranslationHelper
|
15
15
|
include ActionView::Helpers::NumberHelper
|
16
|
-
|
17
|
-
|
16
|
+
begin
|
17
|
+
include Sprockets::Rails::Helper
|
18
|
+
rescue LoadError
|
19
|
+
include Sprockets::Helpers::RailsHelper
|
20
|
+
include Sprockets::Helpers::IsolatedHelper
|
21
|
+
end
|
18
22
|
include ::Rails.application.routes.url_helpers
|
19
23
|
|
20
24
|
attr_accessor :output_buffer
|
data/lib/neo/rails/version.rb
CHANGED
data/neo-rails.gemspec
CHANGED
@@ -17,7 +17,6 @@ Gem::Specification.new do |gem|
|
|
17
17
|
|
18
18
|
gem.add_development_dependency "rake"
|
19
19
|
gem.add_development_dependency "minitest"
|
20
|
-
gem.add_development_dependency "rails", "~> 3.2.7"
|
21
20
|
gem.add_development_dependency "rack-test"
|
22
21
|
gem.add_development_dependency "simplecov"
|
23
22
|
end
|
data/test/exposure_test.rb
CHANGED
@@ -30,6 +30,11 @@ class ExposureTestController < ActionController::Base
|
|
30
30
|
def expose_with_error
|
31
31
|
expose(:unknown) { "unknown" }
|
32
32
|
end
|
33
|
+
|
34
|
+
def expose_nil_value
|
35
|
+
expose(:a) { nil }
|
36
|
+
render :inline => [ exposed?(:a), exposed?(:b) ].inspect
|
37
|
+
end
|
33
38
|
end
|
34
39
|
|
35
40
|
class OtherExposureTestController < ExposureTestController
|
@@ -67,12 +72,14 @@ end
|
|
67
72
|
|
68
73
|
class ExposureTestApp < Rails::Application
|
69
74
|
routes.draw do
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
75
|
+
get ":action" => ExposureTestController
|
76
|
+
get "other/:action" => OtherExposureTestController
|
77
|
+
get "a/:action" => ATestController
|
78
|
+
get "b/:action" => BTestController
|
74
79
|
end
|
75
80
|
|
81
|
+
config.secret_key_base = "a" * 32
|
82
|
+
config.secret_token = "a" * 32
|
76
83
|
config.session_store :disabled
|
77
84
|
config.middleware.delete Rails::Rack::Logger
|
78
85
|
config.middleware.delete ActionDispatch::ShowExceptions
|
@@ -102,6 +109,11 @@ class ExposureTest < NeoRailsCase
|
|
102
109
|
end
|
103
110
|
end
|
104
111
|
|
112
|
+
test "exposes nil value" do
|
113
|
+
get :expose_nil_value
|
114
|
+
assert_equal [ true, false ].inspect, last_response.body
|
115
|
+
end
|
116
|
+
|
105
117
|
test "exposes vars in subclass" do
|
106
118
|
get "other/bar"
|
107
119
|
assert_equal "a;b;c", last_response.body
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jonas Thiel
|
@@ -10,86 +9,62 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2013-04-18 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rake
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - '>='
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '0'
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- -
|
25
|
+
- - '>='
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: '0'
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: minitest
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - '>='
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '0'
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - '>='
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: '0'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: rails
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 3.2.7
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
|
-
requirements:
|
60
|
-
- - ~>
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 3.2.7
|
63
42
|
- !ruby/object:Gem::Dependency
|
64
43
|
name: rack-test
|
65
44
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
45
|
requirements:
|
68
|
-
- -
|
46
|
+
- - '>='
|
69
47
|
- !ruby/object:Gem::Version
|
70
48
|
version: '0'
|
71
49
|
type: :development
|
72
50
|
prerelease: false
|
73
51
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
52
|
requirements:
|
76
|
-
- -
|
53
|
+
- - '>='
|
77
54
|
- !ruby/object:Gem::Version
|
78
55
|
version: '0'
|
79
56
|
- !ruby/object:Gem::Dependency
|
80
57
|
name: simplecov
|
81
58
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
59
|
requirements:
|
84
|
-
- -
|
60
|
+
- - '>='
|
85
61
|
- !ruby/object:Gem::Version
|
86
62
|
version: '0'
|
87
63
|
type: :development
|
88
64
|
prerelease: false
|
89
65
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
66
|
requirements:
|
92
|
-
- -
|
67
|
+
- - '>='
|
93
68
|
- !ruby/object:Gem::Version
|
94
69
|
version: '0'
|
95
70
|
description: Some Rails helpers
|
@@ -132,31 +107,29 @@ files:
|
|
132
107
|
- test/presenter_test.rb
|
133
108
|
homepage: ''
|
134
109
|
licenses: []
|
110
|
+
metadata: {}
|
135
111
|
post_install_message:
|
136
112
|
rdoc_options: []
|
137
113
|
require_paths:
|
138
114
|
- lib
|
139
115
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
-
none: false
|
141
116
|
requirements:
|
142
|
-
- -
|
117
|
+
- - '>='
|
143
118
|
- !ruby/object:Gem::Version
|
144
119
|
version: '0'
|
145
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
121
|
requirements:
|
148
|
-
- -
|
122
|
+
- - '>='
|
149
123
|
- !ruby/object:Gem::Version
|
150
124
|
version: '0'
|
151
125
|
requirements: []
|
152
126
|
rubyforge_project:
|
153
|
-
rubygems_version:
|
127
|
+
rubygems_version: 2.0.0
|
154
128
|
signing_key:
|
155
|
-
specification_version:
|
129
|
+
specification_version: 4
|
156
130
|
summary: Rails mocks, presenters, exposure and scenarios
|
157
131
|
test_files:
|
158
132
|
- test/exposure_test.rb
|
159
133
|
- test/helper.rb
|
160
134
|
- test/mock_test.rb
|
161
135
|
- test/presenter_test.rb
|
162
|
-
has_rdoc:
|