versionist 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/generators/versionist/new_api_version/new_api_version_generator.rb +6 -4
- data/lib/generators/versionist/new_api_version/templates/base_controller_spec.rb +1 -1
- data/lib/generators/versionist/new_api_version/templates/base_presenter_spec.rb +1 -1
- data/lib/generators/versionist/new_controller/new_controller_generator.rb +4 -2
- data/lib/generators/versionist/new_controller/templates/new_controller_spec.rb +1 -1
- data/lib/generators/versionist/new_presenter/new_presenter_generator.rb +3 -1
- data/lib/generators/versionist/new_presenter/templates/new_presenter_spec.rb +1 -1
- data/lib/generators/versionist/rspec_helper.rb +13 -0
- data/lib/versionist.rb +1 -0
- data/lib/versionist/version.rb +1 -1
- data/lib/versionist/version.rb~ +3 -0
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ODUxODYxMzYyNDM5M2JlMWY1NDVhMzEzYjJmY2U0MTExM2UyZjBmMQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ac9417b318b2984f5b59c1e5185a3eb37010d2da
|
4
|
+
data.tar.gz: 151008740186600e0d303dee3b56a4c20602da65
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
M2IxZmZhMWRlZmQxMGRlMmY2Y2RiZGM5NGEwZjhiNThjMjNkNjA3Y2FhZjZh
|
11
|
-
OGFiYmIzNTE4MGU5ZWMzNWI1ZTQwNTg1ZmE5YmRhODlmNWE2Yzk=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OWM4Y2Q5ZmQ3NGQ2MjhlMmZmNDFmMDY3MjFjY2Y1MTYwYTgzZTJmZWQ5OTBl
|
14
|
-
MTllODY5ODA4MGViMWExNmQxMWZmMWYyM2Q2YTI5NGYyZWYyNTI3ZjI4N2Fm
|
15
|
-
ZGJhMTljY2Y3MmI5ZmQ1MTVlMmI2NjJkM2M4YmI5MzY4MTg2ZDE=
|
6
|
+
metadata.gz: 31276bf69db774daa8853f90abf5feba2fad6303dbcc2a7205294b137c7c4f352f763fb882b5c9e20c719b2a3497db8da00f660a838c26a0ec314bdc64ef2b82
|
7
|
+
data.tar.gz: 4c41d6f1087625412b7e428de21839a8d264a91b61dc012ff3ba23ca528247e34e589e603c9a2a44f45d76130567f256fbed6e510f2491a91a99efc7ad406bfc
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Versionist
|
2
2
|
class NewApiVersionGenerator < Rails::Generators::Base
|
3
3
|
include InflectorFixes
|
4
|
+
include RspecHelper
|
4
5
|
|
5
6
|
desc "creates the infrastructure for a new API version"
|
6
7
|
|
@@ -14,7 +15,6 @@ module Versionist
|
|
14
15
|
class_option :path, :type => :hash, :group => :path
|
15
16
|
class_option :defaults, :type => :hash, :group => :defaults
|
16
17
|
|
17
|
-
|
18
18
|
def verify_options
|
19
19
|
raise "Must specify at least one versioning strategy option" if !['header', 'parameter', 'path'].any? {|strategy| options.has_key?(strategy)}
|
20
20
|
if options.has_key?("header")
|
@@ -69,10 +69,11 @@ module Versionist
|
|
69
69
|
empty_directory "test/integration/#{module_name_for_path(module_name)}"
|
70
70
|
template 'base_controller_integration_test.rb', File.join("test", "integration", "#{module_name_for_path(module_name)}", "base_controller_test.rb")
|
71
71
|
when :rspec
|
72
|
+
@rspec_require_file = rspec_helper_filename
|
72
73
|
empty_directory "spec/controllers/#{module_name_for_path(module_name)}"
|
73
|
-
template 'base_controller_spec.rb', File.join("spec", "controllers", "#{module_name_for_path(module_name)}", "base_controller_spec.rb")
|
74
|
+
template 'base_controller_spec.rb', File.join("spec", "controllers", "#{module_name_for_path(module_name)}", "base_controller_spec.rb"), :assigns => { :rspec_require_file => @rspec_require_file }
|
74
75
|
empty_directory "spec/requests/#{module_name_for_path(module_name)}"
|
75
|
-
template 'base_controller_spec.rb', File.join("spec", "requests", "#{module_name_for_path(module_name)}", "base_controller_spec.rb")
|
76
|
+
template 'base_controller_spec.rb', File.join("spec", "requests", "#{module_name_for_path(module_name)}", "base_controller_spec.rb"), :assigns => { :rspec_require_file => @rspec_require_file }
|
76
77
|
else
|
77
78
|
say "Unsupported test_framework: #{Versionist.configuration.configured_test_framework}"
|
78
79
|
end
|
@@ -93,8 +94,9 @@ module Versionist
|
|
93
94
|
empty_directory "test/presenters/#{module_name_for_path(module_name)}"
|
94
95
|
template 'base_presenter_test.rb', File.join("test", "presenters", "#{module_name_for_path(module_name)}", "base_presenter_test.rb")
|
95
96
|
when :rspec
|
97
|
+
@rspec_require_file = rspec_helper_filename
|
96
98
|
empty_directory "spec/presenters/#{module_name_for_path(module_name)}"
|
97
|
-
template 'base_presenter_spec.rb', File.join("spec", "presenters", "#{module_name_for_path(module_name)}", "base_presenter_spec.rb")
|
99
|
+
template 'base_presenter_spec.rb', File.join("spec", "presenters", "#{module_name_for_path(module_name)}", "base_presenter_spec.rb"), :assigns => { :rspec_require_file => @rspec_require_file }
|
98
100
|
else
|
99
101
|
say "Unsupported test_framework: #{Versionist.configuration.configured_test_framework}"
|
100
102
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Versionist
|
2
2
|
class NewControllerGenerator < Rails::Generators::NamedBase
|
3
3
|
include InflectorFixes
|
4
|
+
include RspecHelper
|
4
5
|
|
5
6
|
desc "creates a new controller for an existing API version"
|
6
7
|
source_root File.expand_path('../templates', __FILE__)
|
@@ -34,8 +35,9 @@ module Versionist
|
|
34
35
|
template 'new_controller_functional_test.rb', File.join("test", "functional", "#{module_name_for_path(module_name)}", "#{file_name}_controller_test.rb")
|
35
36
|
template 'new_controller_integration_test.rb', File.join("test", "integration", "#{module_name_for_path(module_name)}", "#{file_name}_controller_test.rb")
|
36
37
|
when :rspec
|
37
|
-
|
38
|
-
template 'new_controller_spec.rb', File.join("spec", "
|
38
|
+
@rspec_require_file = rspec_helper_filename
|
39
|
+
template 'new_controller_spec.rb', File.join("spec", "controllers", "#{module_name_for_path(module_name)}", "#{file_name}_controller_spec.rb"), :assigns => { :rspec_require_file => @rspec_require_file }
|
40
|
+
template 'new_controller_spec.rb', File.join("spec", "requests", "#{module_name_for_path(module_name)}", "#{file_name}_controller_spec.rb"), :assigns => { :rspec_require_file => @rspec_require_file }
|
39
41
|
else
|
40
42
|
say "Unsupported test_framework: #{Versionist.configuration.configured_test_framework}"
|
41
43
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Versionist
|
2
2
|
class NewPresenterGenerator < Rails::Generators::NamedBase
|
3
3
|
include InflectorFixes
|
4
|
+
include RspecHelper
|
4
5
|
|
5
6
|
desc "creates a new presenter for an existing API version"
|
6
7
|
source_root File.expand_path('../templates', __FILE__)
|
@@ -20,7 +21,8 @@ module Versionist
|
|
20
21
|
when :test_unit
|
21
22
|
template 'new_presenter_test.rb', File.join("test", "presenters", "#{module_name_for_path(module_name)}", "#{file_name}_presenter_test.rb")
|
22
23
|
when :rspec
|
23
|
-
|
24
|
+
@rspec_require_file = rspec_helper_filename
|
25
|
+
template 'new_presenter_spec.rb', File.join("spec", "presenters", "#{module_name_for_path(module_name)}", "#{file_name}_presenter_spec.rb"), :assigns => { :rspec_require_file => @rspec_require_file }
|
24
26
|
else
|
25
27
|
say "Unsupported test_framework: #{Versionist.configuration.configured_test_framework}"
|
26
28
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Versionist
|
2
|
+
module RspecHelper
|
3
|
+
# Gets the name of the helper file to require in spec files
|
4
|
+
# Accounting for rspec-rails 2 vs rspec-rails 3
|
5
|
+
def rspec_helper_filename
|
6
|
+
if File.exists? "spec/rails_helper.rb"
|
7
|
+
"rails_helper"
|
8
|
+
else
|
9
|
+
"spec_helper"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/versionist.rb
CHANGED
@@ -5,6 +5,7 @@ module Versionist
|
|
5
5
|
|
6
6
|
autoload :Configuration
|
7
7
|
autoload :InflectorFixes, "generators/versionist/inflector_fixes"
|
8
|
+
autoload :RspecHelper, "generators/versionist/rspec_helper"
|
8
9
|
autoload :CopyApiVersionGenerator, "generators/versionist/copy_api_version/copy_api_version_generator"
|
9
10
|
autoload :NewApiVersionGenerator, "generators/versionist/new_api_version/new_api_version_generator"
|
10
11
|
autoload :NewControllerGenerator, "generators/versionist/new_controller/new_controller_generator"
|
data/lib/versionist/version.rb
CHANGED
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: versionist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Ploetz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: yard
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.7'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.7'
|
55
55
|
description: A plugin for versioning Rails based RESTful APIs.
|
@@ -83,12 +83,14 @@ files:
|
|
83
83
|
- lib/generators/versionist/new_presenter/templates/new_presenter.rb
|
84
84
|
- lib/generators/versionist/new_presenter/templates/new_presenter_spec.rb
|
85
85
|
- lib/generators/versionist/new_presenter/templates/new_presenter_test.rb
|
86
|
+
- lib/generators/versionist/rspec_helper.rb
|
86
87
|
- lib/versionist.rb
|
87
88
|
- lib/versionist/configuration.rb
|
88
89
|
- lib/versionist/middleware.rb
|
89
90
|
- lib/versionist/railtie.rb
|
90
91
|
- lib/versionist/routing.rb
|
91
92
|
- lib/versionist/version.rb
|
93
|
+
- lib/versionist/version.rb~
|
92
94
|
- lib/versionist/versioning_strategy.rb
|
93
95
|
- lib/versionist/versioning_strategy/base.rb
|
94
96
|
- lib/versionist/versioning_strategy/default.rb
|
@@ -101,24 +103,24 @@ licenses:
|
|
101
103
|
metadata: {}
|
102
104
|
post_install_message:
|
103
105
|
rdoc_options:
|
104
|
-
- --charset=UTF-8
|
106
|
+
- "--charset=UTF-8"
|
105
107
|
require_paths:
|
106
108
|
- lib
|
107
109
|
required_ruby_version: !ruby/object:Gem::Requirement
|
108
110
|
requirements:
|
109
|
-
- -
|
111
|
+
- - ">="
|
110
112
|
- !ruby/object:Gem::Version
|
111
113
|
version: '0'
|
112
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
115
|
requirements:
|
114
|
-
- -
|
116
|
+
- - ">="
|
115
117
|
- !ruby/object:Gem::Version
|
116
118
|
version: 1.3.6
|
117
119
|
requirements: []
|
118
120
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.
|
121
|
+
rubygems_version: 2.2.2
|
120
122
|
signing_key:
|
121
123
|
specification_version: 4
|
122
|
-
summary: versionist-1.4.
|
124
|
+
summary: versionist-1.4.1
|
123
125
|
test_files: []
|
124
126
|
has_rdoc:
|