neo-rails 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8549602e85a4369b19f06264c165cd792d8ab642
4
- data.tar.gz: fb90210beafab8abe23762cafa9d0e37785e16f7
3
+ metadata.gz: 246caa344b7594de4e7c2bb542ad3f6baf4c7861
4
+ data.tar.gz: 9b333885c25ac087ffbfcb9b6b70e96ccb19709e
5
5
  SHA512:
6
- metadata.gz: 259a22ede3cc2bb09179ec161f24235eeb8707a0cf9c24e10f59ea893aab68a9f850b5a08b3229b87240fab0c8a008a073a94087e152aac6f1225c171674c20b
7
- data.tar.gz: 6d4cdcf6ad181f999a2e84fba117dfd2c999885b70263d5ef57e720b1a2930dc3d3db5d2714991499483a0503380e0ce4027954301f7e628214f3592ee5af35a
6
+ metadata.gz: 2c24e174fc82459722c0233abee9bff73cc02c8a7a9bfb80cc7ada2a7f3bd0de4c59c3dc82f1590859809305231c6b50b81f40b624622174ea78f89478767dcf
7
+ data.tar.gz: 57a78c3c34710061bf57fe372d929b8673854140c606f90e9be6c2a2884f159697262df910df9ac946f046deb83fc5a536c66d775be883b2e33e1da063f91fce
@@ -1,27 +1,19 @@
1
1
  language: ruby
2
2
  sudo: false
3
3
  cache: bundler
4
+ after_success:
5
+ - '[ "${TRAVIS_JOB_NUMBER#*.}" = "1" ] && bundle exec codeclimate-test-reporter'
4
6
  rvm:
5
7
  # - ruby-head (see as below)
6
- - 2.2
7
- - 2.1
8
- - 2.0
9
- - 1.9.3
8
+ - 2.4.1
9
+ - 2.3.4
10
10
  env:
11
11
  global:
12
12
  - CODECLIMATE_REPO_TOKEN=f88e6216112f3039c2ceb879c813ad95b99e4ac13413a7fc104dc176eb7c63bb
13
13
  matrix:
14
- - RAILS_VERSION=3.2
15
- - RAILS_VERSION=4.0
16
- - RAILS_VERSION=4.1
14
+ - RAILS_VERSION=5.1
15
+ - RAILS_VERSION=5.0
17
16
  - RAILS_VERSION=4.2
18
17
  matrix:
19
18
  allow_failures:
20
19
  fast_finish: true
21
- notifications:
22
- webhooks:
23
- urls:
24
- - https://webhooks.gitter.im/e/cdc790028864bf9cbc44
25
- on_success: change # options: [always|never|change] default: always
26
- on_failure: always # options: [always|never|change] default: always
27
- on_start: false # default: false
data/Gemfile CHANGED
@@ -3,16 +3,14 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in neo-rails.gemspec
4
4
  gemspec
5
5
 
6
- rails_version = ENV['RAILS_VERSION']
7
- case rails_version
6
+ case ENV['RAILS_VERSION']
8
7
  when /^(\d+\.\d+)/
9
8
  gem 'rails', "~> #{$1}.0"
10
- when NilClass
11
- abort "Missing env RAILS_VERSION"
12
9
  else
13
- abort "Rails version #{rails_version.inspect} not supported"
10
+ gem 'rails'
14
11
  end
15
12
 
16
- if ENV['CODECLIMATE_REPO_TOKEN']
17
- gem "codeclimate-test-reporter", :group => :test, :require => nil
13
+ group :test do
14
+ gem 'simplecov'
15
+ gem 'codeclimate-test-reporter', '~> 1.0.0'
18
16
  end
data/README.md CHANGED
@@ -30,7 +30,7 @@ This gem includes:
30
30
 
31
31
  Add this line to your application's Gemfile:
32
32
 
33
- gem 'neo-rails'
33
+ gem 'neo-rails', '~> 0.4.0'
34
34
 
35
35
  And then execute:
36
36
 
@@ -153,3 +153,15 @@ In app/layouts/application.html.erb
153
153
  3. Commit your changes (`git commit -am 'Added some feature'`)
154
154
  4. Push to the branch (`git push origin my-new-feature`)
155
155
  5. Create new Pull Request
156
+
157
+ ## Release
158
+
159
+ Follow these steps to release this gem:
160
+
161
+ # Bump version in
162
+ edit lib/neo/rails/version.rb
163
+ edit README.md
164
+
165
+ git commit -m "Release X.Y.Z"
166
+
167
+ rake release
data/Rakefile CHANGED
@@ -8,4 +8,5 @@ Rake::TestTask.new do |t|
8
8
  t.libs << "test"
9
9
  t.test_files = FileList['test/**/*_test.rb']
10
10
  t.verbose = true
11
+ t.warning = true
11
12
  end
@@ -6,7 +6,7 @@ class MockGenerator < Rails::Generators::NamedBase
6
6
 
7
7
  def create_mock_file
8
8
  path = "app/mocks/#{file_name}_mock.rb"
9
- if FileTest.exists?path
9
+ if FileTest.exist? path
10
10
  raise FileExistError, "This filename ist used by another mock:#{path}"
11
11
  end
12
12
 
@@ -16,4 +16,4 @@ class MockGenerator < Rails::Generators::NamedBase
16
16
 
17
17
  end
18
18
 
19
- class FileExistError < StandardError; end
19
+ class FileExistError < StandardError; end
@@ -6,7 +6,7 @@ class PresenterGenerator < Rails::Generators::NamedBase
6
6
 
7
7
  def create_presenter_file
8
8
  path = "app/presenters/#{file_name}_presenter.rb"
9
- if FileTest.exists?path
9
+ if FileTest.exist? path
10
10
  raise FileExistError, "This filename ist used by another presenter:#{path}"
11
11
  end
12
12
 
@@ -17,7 +17,7 @@ class PresenterGenerator < Rails::Generators::NamedBase
17
17
 
18
18
  def create_presenter_test_file
19
19
  path = "test/presenters/#{file_name}_presenter_test.rb"
20
- if FileTest.exists?path
20
+ if FileTest.exist? path
21
21
  raise FileExistError, "This filename ist used by another PresenterTest:#{path}"
22
22
  end
23
23
 
@@ -25,7 +25,7 @@ class PresenterGenerator < Rails::Generators::NamedBase
25
25
  replace_class_name path
26
26
  end
27
27
 
28
- private
28
+ private
29
29
  def replace_class_name path
30
30
  gsub_file path, '-classname-' , "#{class_name}"
31
31
  end
@@ -33,7 +33,7 @@ class PresenterGenerator < Rails::Generators::NamedBase
33
33
  def replace_singular_name path
34
34
  gsub_file path, 'singular_name' , "#{plural_name.singularize}"
35
35
  end
36
-
36
+
37
37
  end
38
38
 
39
- class FileExistError < StandardError; end
39
+ class FileExistError < StandardError; end
@@ -11,7 +11,7 @@ module Neo
11
11
 
12
12
  initializer "neo-rails.presenter_method" do
13
13
  ActiveSupport.on_load(:action_controller) do
14
- before_filter do |controller|
14
+ before_action do |controller|
15
15
  Neo::Rails::Presenter.view_context = controller.view_context
16
16
  end
17
17
  end
@@ -41,7 +41,6 @@ module Neo
41
41
  #
42
42
  # Raise UndeclaredVariableError if access variable wasn't declared before.
43
43
  def expose(key, value=nil)
44
- name = key.to_sym
45
44
  value = yield if block_given?
46
45
  self.exposures[key] = value
47
46
  end
@@ -1,5 +1,5 @@
1
1
  module Neo
2
2
  module Rails
3
- VERSION = "0.3.2"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -1,8 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  require File.expand_path('../lib/neo/rails/version', __FILE__)
3
3
 
4
- rails_version = ENV['RAILS_VERSION']
5
-
6
4
  Gem::Specification.new do |gem|
7
5
  gem.authors = ["Jonas Thiel", "Peter Suschlik"]
8
6
  gem.email = ["jt@neopoly.de", "ps@neopoly.de"]
@@ -18,22 +16,17 @@ Gem::Specification.new do |gem|
18
16
  gem.version = Neo::Rails::VERSION
19
17
 
20
18
  gem.add_dependency "view_model-rails"
21
- gem.add_dependency "mime-types", ['>= 1.0', '< 3.0']
22
- gem.add_dependency "nokogiri", '~> 1.6.8'
19
+ gem.add_dependency "mime-types", '~> 3.1'
20
+ gem.add_dependency "nokogiri", '~> 1.8'
23
21
 
24
- case rails_version
22
+ case ENV['RAILS_VERSION']
25
23
  when '3.2'
26
24
  gem.add_development_dependency "minitest", '~> 4.7'
27
25
  gem.add_development_dependency 'test-unit', '~> 3.0'
28
- when /.*/
29
- gem.add_development_dependency "minitest"
30
- when NilClass
31
- abort "Missing env RAILS_VERSION"
32
26
  else
33
- abort "Rails version #{rails_version.inspect} not supported"
27
+ gem.add_development_dependency "minitest"
34
28
  end
35
29
 
36
30
  gem.add_development_dependency "rake"
37
31
  gem.add_development_dependency "rack-test"
38
- gem.add_development_dependency "simplecov"
39
32
  end
@@ -11,10 +11,6 @@ class ExposureTestController < ActionController::Base
11
11
 
12
12
  exposes :a, :b
13
13
 
14
- def foo
15
- render :text => "bar"
16
- end
17
-
18
14
  def expose_via_value
19
15
  expose :a, "a"
20
16
  expose :b, "b"
@@ -79,10 +75,12 @@ end
79
75
 
80
76
  class ExposureTestApp < Rails::Application
81
77
  routes.draw do
82
- get ":action" => ExposureTestController
83
- get "other/:action" => OtherExposureTestController
84
- get "a/:action" => ATestController
85
- get "b/:action" => BTestController
78
+ ExposureTestController.action_methods.each do |action|
79
+ get action => "exposure_test##{action}"
80
+ end
81
+ get "other/bar" => "other_exposure_test#bar"
82
+ get "a/baz" => "a_test#baz"
83
+ get "b/baz" => "b_test#baz"
86
84
  end
87
85
 
88
86
  config.secret_key_base = "a" * 32
@@ -1,7 +1,5 @@
1
- if ENV['CODECLIMATE_REPO_TOKEN']
2
- require 'simplecov'
3
- SimpleCov.start
4
- end
1
+ require 'simplecov'
2
+ SimpleCov.start
5
3
 
6
4
  require 'simplecov' if ENV['COVERAGE']
7
5
  require 'rails/generators'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Thiel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-14 00:00:00.000000000 Z
12
+ date: 2017-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: view_model-rails
@@ -29,66 +29,32 @@ dependencies:
29
29
  name: mime-types
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '1.0'
35
- - - "<"
32
+ - - "~>"
36
33
  - !ruby/object:Gem::Version
37
- version: '3.0'
34
+ version: '3.1'
38
35
  type: :runtime
39
36
  prerelease: false
40
37
  version_requirements: !ruby/object:Gem::Requirement
41
38
  requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: '1.0'
45
- - - "<"
39
+ - - "~>"
46
40
  - !ruby/object:Gem::Version
47
- version: '3.0'
41
+ version: '3.1'
48
42
  - !ruby/object:Gem::Dependency
49
43
  name: nokogiri
50
44
  requirement: !ruby/object:Gem::Requirement
51
45
  requirements:
52
46
  - - "~>"
53
47
  - !ruby/object:Gem::Version
54
- version: 1.6.8
48
+ version: '1.8'
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
52
  requirements:
59
53
  - - "~>"
60
54
  - !ruby/object:Gem::Version
61
- version: 1.6.8
55
+ version: '1.8'
62
56
  - !ruby/object:Gem::Dependency
63
57
  name: minitest
64
- requirement: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '4.7'
69
- type: :development
70
- prerelease: false
71
- version_requirements: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '4.7'
76
- - !ruby/object:Gem::Dependency
77
- name: test-unit
78
- requirement: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '3.0'
83
- type: :development
84
- prerelease: false
85
- version_requirements: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '3.0'
90
- - !ruby/object:Gem::Dependency
91
- name: rake
92
58
  requirement: !ruby/object:Gem::Requirement
93
59
  requirements:
94
60
  - - ">="
@@ -102,7 +68,7 @@ dependencies:
102
68
  - !ruby/object:Gem::Version
103
69
  version: '0'
104
70
  - !ruby/object:Gem::Dependency
105
- name: rack-test
71
+ name: rake
106
72
  requirement: !ruby/object:Gem::Requirement
107
73
  requirements:
108
74
  - - ">="
@@ -116,7 +82,7 @@ dependencies:
116
82
  - !ruby/object:Gem::Version
117
83
  version: '0'
118
84
  - !ruby/object:Gem::Dependency
119
- name: simplecov
85
+ name: rack-test
120
86
  requirement: !ruby/object:Gem::Requirement
121
87
  requirements:
122
88
  - - ">="
@@ -138,7 +104,6 @@ extensions: []
138
104
  extra_rdoc_files: []
139
105
  files:
140
106
  - ".gitignore"
141
- - ".simplecov"
142
107
  - ".travis.yml"
143
108
  - Gemfile
144
109
  - LICENSE
@@ -197,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
162
  version: '0'
198
163
  requirements: []
199
164
  rubyforge_project:
200
- rubygems_version: 2.4.8
165
+ rubygems_version: 2.5.1
201
166
  signing_key:
202
167
  specification_version: 4
203
168
  summary: Rails mocks, presenters, exposure and scenarios
data/.simplecov DELETED
@@ -1,2 +0,0 @@
1
- SimpleCov.coverage_dir "tmp/coverage"
2
- SimpleCov.start