api_me 0.3.6 → 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: d1cf140e09ecf4b5773e21ece939ed3065942283
4
- data.tar.gz: 0110c77f7a39fe0511872f935c8efafcf4b529ed
3
+ metadata.gz: 0658898c8db26ece5dcf4eba4465c41a4c944007
4
+ data.tar.gz: 1ac19dc633b67d85039621edee0c9afc06e0f76c
5
5
  SHA512:
6
- metadata.gz: aadc59fd10b73f2d0e9a4971fe1b3e84c5d8e981e34ec07f898da236039af6c3c47a8944b43ceacabd9e0c247661e477915ba2389a274438a024a873b20e42ce
7
- data.tar.gz: 54ac80d1afab0a9cae531782be418124a4240fd832c8934245bc9b0006c44d2d9143be164cf06f2de4aeda65551312d4baa01d053f025208cd3e81d7234caea6
6
+ metadata.gz: 9011c9ca170a159c3802421d85662be738038e32337655ef74a412ddacd48dc12727cff413db45217c8fbb4294493e34ba2728b3d2148a3bfb572fb3f6a66195
7
+ data.tar.gz: 5bf8be52281acd86adc7a8316893e2a55b543ca6b22d46bc6e79be11ad8a1d5854142a668515963fa93ef037a3074342f65f91ee5aa75f6553b24977d0011453
data/api_me.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_runtime_dependency 'activerecord', '>= 3.2.0'
22
22
  s.add_runtime_dependency 'activesupport', '>= 3.2.0'
23
- s.add_runtime_dependency 'pundit', '~> 0.1'
23
+ s.add_runtime_dependency 'pundit', '~> 1.0'
24
24
  s.add_runtime_dependency 'active_model_serializers', '~> 0.8.0'
25
25
  s.add_runtime_dependency 'search_object', '~> 1.0'
26
26
 
@@ -1,3 +1,3 @@
1
1
  module ApiMe
2
- VERSION = '0.3.6'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -13,6 +13,7 @@ module ApiMe
13
13
  controllers_namespace,
14
14
  controllers_api_version,
15
15
  "#{plural_name}_controller.rb")
16
+ insert_after_version(plural_name)
16
17
  end
17
18
 
18
19
  def controllers_namespace
@@ -67,7 +68,32 @@ module ApiMe
67
68
  end
68
69
  end
69
70
 
70
- hook_for :test_framework
71
+ private
72
+
73
+ def insert_after_version(resource_name)
74
+ maybe_create_api_v1_namespace
75
+
76
+ in_root do
77
+ insert_into_file(
78
+ 'config/routes.rb',
79
+ " resources :#{resource_name}\n",
80
+ after: "namespace :#{controllers_api_version} do\n"
81
+ )
82
+ end
83
+ end
84
+
85
+ def maybe_create_api_v1_namespace
86
+ in_root do
87
+ unless File.readlines('config/routes.rb').grep("namespace #{controllers_namespace} do")
88
+ route <<-ROUTE
89
+ namespace :#{controllers_namespace} do
90
+ namespace :#{controllers_api_version} do
91
+ end
92
+ end
93
+ ROUTE
94
+ end
95
+ end
96
+ end
71
97
  end
72
98
  end
73
99
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Clopton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-09 00:00:00.000000000 Z
12
+ date: 2015-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '0.1'
48
+ version: '1.0'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '0.1'
55
+ version: '1.0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: active_model_serializers
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  version: '0'
232
232
  requirements: []
233
233
  rubyforge_project:
234
- rubygems_version: 2.2.2
234
+ rubygems_version: 2.4.6
235
235
  signing_key:
236
236
  specification_version: 4
237
237
  summary: Api Me