social_snippet-registry_core 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTNhYTYxNTZmOGUxYzVmMjEzZDM3NDk5NDJiMzg4ZTRmNmU0ZjViNQ==
4
+ YzRmZGQ0NGFmZjFjMjk2ODhmYTE5YjEyOTE0NTJkZDljYjVjMzk0Yg==
5
5
  data.tar.gz: !binary |-
6
- ZTAwYTM3M2FkZTUwZTlmNDA2ZWZlMGVjMzQ2M2Y1Y2Q1Yjc0MmFkYw==
6
+ Mjc3NGRjZDliZDYzMTJjMTllOGFmMDlkMWM2ODk2NTFjNWEwNTBkOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTlkNGIzNTVlYTUxZGRiZDJlMTE4Zjc0ODg5NGY2ODFlMjU5YWY2ZTE0Y2E0
10
- Y2ZiODk3YWU5NTI1NWU0Mjc3M2YxZWExNzMyZTEwM2YzYTA0YzcwZmE3NDEy
11
- MDE5ODJmMGU2ZmZjNGY0ZDZiYTY0NDNiMTk0N2QwNzhjMWE3MjU=
9
+ YmU3ODEyZWY2ZWZkNDMzZThhMGQxY2UwMjIxYWQ5ODU5YjFmNGRhODBiZmRm
10
+ YWI1NjEyNGFlMjNmZDA5ZGQzODZjZDU5ZWIwNjkzODFkNzFjNzE2OTZjZGRh
11
+ OWYxMzUxYTk5ZWM0MDkxODc0N2UyOWYyMTZkNDdhZmQ3YzFjMzQ=
12
12
  data.tar.gz: !binary |-
13
- MmExMWMxYWZmNGZiNGIxZDU0MzRjZDM0NTRmMDA0NjJlZWMxMjVlZGQ2MmFi
14
- NjUzZjMxMDFmYjc1NjRjZDY5MmVjMTJkNGY4MzEyMjc3OTNiYzExZDBhY2E0
15
- YTdkOTc2YmQ5NWY5MmIxMjhmMDNjNGU5YjNiZDI3ZTM2YTEyM2E=
13
+ Y2I5OTE3ZGM3NWIwNzgwYmE2YzYzMjc1NzcyZGMxNTA4MTczYTE2YjRmYzM3
14
+ YzkzYzQzZmY4YjE5YjZlNjFmZWVhYjcyYTcwNGM5NGU1YWU4MjYwOGQxMjhl
15
+ MjU5NzgzYTk0NWVlOTk3NzNmMDllOWZkNmY5MWYzMGUzNTBjMWY=
data/.travis.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
+ - "2.2"
4
5
  - "2.1"
5
6
  - "2.0"
6
7
  - "1.9"
@@ -17,6 +18,7 @@ install:
17
18
 
18
19
  script:
19
20
  - bundle exec rake spec
21
+ - bundle exec rake test
20
22
 
21
23
  cache:
22
24
  directories:
@@ -29,3 +31,6 @@ deploy:
29
31
  secure: "IJ++p1ozWwXqK83UZR8xAdzZR5XHVAr5uU2xKCIRsHYe+wi7c0SgOqA+j5VM9US+YTB3zT7gXdvTAajNMR5sPp6prbzFe4BD2G8RfrFAoPkN+GNzgSVbgXk8DQnmJVKDPleSaqo68AA244dGVPqHyBVi+rFFxc7jMtQPlttBJYE="
30
32
  gem:
31
33
  master: social_snippet-registry_core
34
+ on:
35
+ repo: social-snippet/social-snippet-registry-core
36
+ ruby: "2.2"
data/Gemfile CHANGED
@@ -3,16 +3,3 @@ source 'https://rubygems.org'
3
3
  # Distribute your app as a gem
4
4
  gemspec
5
5
 
6
- group :test do
7
- gem "rspec"
8
- gem "database_cleaner"
9
- gem "factory_girl"
10
- gem "rack-test"
11
- gem "mongoid-tree"
12
- end
13
-
14
- group :debug do
15
- gem "shotgun"
16
- gem "pry-byebug"
17
- end
18
-
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # SocialSnippet::RegistryCore
2
2
 
3
+ [![Gem Version](https://img.shields.io/gem/v/social_snippet-registry_core.svg)](https://rubygems.org/gems/social_snippet-registry_core)
4
+ [![Build Status](https://img.shields.io/travis/social-snippet/social-snippet-registry-core.svg)](https://travis-ci.org/social-snippet/social-snippet-registry-core)
5
+ [![Code Climate](https://img.shields.io/codeclimate/github/social-snippet/social-snippet-registry-core.svg)](https://codeclimate.com/github/social-snippet/social-snippet-registry-core)
6
+ [![Test Coverage](https://img.shields.io/codeclimate/coverage/github/social-snippet/social-snippet-registry-core.svg)](https://codeclimate.com/github/social-snippet/social-snippet-registry-core)
7
+
3
8
  TODO: Write a gem description
4
9
 
5
10
  ## Installation
@@ -27,7 +27,7 @@ module SocialSnippet::Registry::WebAPI
27
27
  info = fetcher.snippet_json(repo_url)
28
28
  repo = Repository.create_by_snippet_json(info)
29
29
  repo.url = repo_url
30
- repo.save
30
+ repo.save!
31
31
 
32
32
  "ok"
33
33
  end
@@ -50,6 +50,7 @@ class SocialSnippet::Registry::WebAPI::Repository
50
50
  validates_presence_of :url
51
51
 
52
52
  validates_each :dependencies do |model, key, value|
53
+ next unless value.is_a?(Array)
53
54
  value.each do |dep|
54
55
  unless self.is_valid_repo_name?(dep)
55
56
  model.errors[:dependencies] << "invalid deps"
@@ -59,12 +60,14 @@ class SocialSnippet::Registry::WebAPI::Repository
59
60
  end
60
61
 
61
62
  validates_each :dependencies do |model, key, value|
63
+ next unless value.is_a?(Array)
62
64
  model.errors[:dependencies] << "The size of dependencies must be less than 64" if value.length > 64
63
65
  end
64
66
 
65
67
  validates_length_of :license, :maximum => 64
66
68
 
67
69
  validates_each :languages do |model, key, value|
70
+ next unless value.is_a?(Array)
68
71
  value.each do |lang|
69
72
  unless self.is_valid_language?(lang)
70
73
  model.errors[:languages] << "invalid language"
@@ -74,6 +77,7 @@ class SocialSnippet::Registry::WebAPI::Repository
74
77
  end
75
78
 
76
79
  validates_each :languages do |model, key, value|
80
+ next unless value.is_a?(Array)
77
81
  model.errors[:languages] << "The size of languages must be less than 64" if value.length > 64
78
82
  end
79
83
 
@@ -1,5 +1,5 @@
1
1
  module SocialSnippet
2
2
  module RegistryCore
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
@@ -20,8 +20,6 @@ Gem::Specification.new do |spec|
20
20
  spec.required_ruby_version = ">= 1.9"
21
21
 
22
22
  spec.add_runtime_dependency "bundler"
23
- spec.add_runtime_dependency "rake"
24
-
25
23
  spec.add_runtime_dependency "padrino", "~> 0.12"
26
24
  spec.add_runtime_dependency "thin"
27
25
  spec.add_runtime_dependency "mongoid", "~> 4.0"
@@ -33,4 +31,17 @@ Gem::Specification.new do |spec|
33
31
  spec.add_runtime_dependency "version_sorter"
34
32
  spec.add_runtime_dependency "octokit"
35
33
  spec.add_runtime_dependency "omniauth-github"
34
+
35
+ spec.add_development_dependency "rake"
36
+ spec.add_development_dependency "codeclimate-test-reporter"
37
+ spec.add_development_dependency "rspec"
38
+ spec.add_development_dependency "database_cleaner"
39
+ spec.add_development_dependency "factory_girl"
40
+ spec.add_development_dependency "rack-test"
41
+ spec.add_development_dependency "mongoid-tree"
42
+
43
+ if ENV["SOCIAL_SNIPPET_DEBUG"] === "true"
44
+ spec.add_development_dependency "shotgun"
45
+ spec.add_development_dependency "pry-byebug"
46
+ end
36
47
  end
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  ENV["RACK_ENV"] = "test"
2
2
 
3
3
  require "bundler/setup"
4
+ require "spec_helpers/codeclimate_helper"
4
5
  require "spec_helpers/rack_test_helper"
5
6
  require "spec_helpers/database_cleaner_helper"
6
7
  require "spec_helpers/factory_girl_helper"
@@ -0,0 +1,4 @@
1
+ if ENV["TRAVIS"] == "true"
2
+ require "codeclimate-test-reporter"
3
+ CodeClimate::TestReporter.start
4
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_snippet-registry_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroyuki Sano
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: padrino
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -178,6 +164,104 @@ dependencies:
178
164
  - - ! '>='
179
165
  - !ruby/object:Gem::Version
180
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rake
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ! '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: codeclimate-test-reporter
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ! '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ! '>='
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rspec
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ! '>='
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ! '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: database_cleaner
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ! '>='
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ! '>='
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: factory_girl
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ! '>='
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ! '>='
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
237
+ - !ruby/object:Gem::Dependency
238
+ name: rack-test
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ! '>='
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ! '>='
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: mongoid-tree
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ! '>='
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ! '>='
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
181
265
  description:
182
266
  email:
183
267
  - sh19910711@gmail.com
@@ -217,6 +301,7 @@ files:
217
301
  - lib/social_snippet/registry_core/version_helpers.rb
218
302
  - social_snippet-registry_core.gemspec
219
303
  - spec/spec_helper.rb
304
+ - spec/spec_helpers/codeclimate_helper.rb
220
305
  - spec/spec_helpers/database_cleaner_helper.rb
221
306
  - spec/spec_helpers/factory_girl_helper.rb
222
307
  - spec/spec_helpers/rack_test_helper.rb
@@ -250,6 +335,7 @@ specification_version: 4
250
335
  summary: The server-side core classes for social-snippet-registry
251
336
  test_files:
252
337
  - spec/spec_helper.rb
338
+ - spec/spec_helpers/codeclimate_helper.rb
253
339
  - spec/spec_helpers/database_cleaner_helper.rb
254
340
  - spec/spec_helpers/factory_girl_helper.rb
255
341
  - spec/spec_helpers/rack_test_helper.rb