ants 0.3.9 → 0.3.10

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: 6a28c13709ccfad3dd8b3f61cb3e7928d57d85af
4
- data.tar.gz: 1753c8d2ce2aa021478cb0ecba65650f3c6bb3e7
3
+ metadata.gz: 0e73ca593b7b7b48c2ba1876b520cc4edebe74b1
4
+ data.tar.gz: 65f19e6fd3fb394216d39b9e0870cecd85f7e337
5
5
  SHA512:
6
- metadata.gz: d76803eb7462cdd16f05914fd460faac70389f8077eba1aa3168d0bf378d40f78d6077f933f347e20a3454a5518361a04c5eec90257e7c6a71855aa40c8d3048
7
- data.tar.gz: 511bc1e6f8a2dc69c193f585c26e671a6538d184bcdd6a38c376eda44c1883b1cd73fc1791eea0e4350f4b31b59937eb54c5a1c6c844d23d4d446df88fc6ffce
6
+ metadata.gz: 91c5b76af30c895a2796fb78d94779c32084f327dd0016b1060ed14a3c32188edeabb2e7eb1af9c4f9c54372feea8a41590331f7e0c3ca7b8fd4887902a07009
7
+ data.tar.gz: d38f27298fd0e5f0b6b1f84265c9b4f2f7bf2fbc6990f0978803536fb8728be296b23f937e6b61bc226ef0e75ab345b06800a0a28ebb3857290b548db5abece7
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ants (0.3.9)
4
+ ants (0.3.10)
5
5
  devise
6
+ meta-tags
6
7
  mongoid (>= 4.0)
7
8
  mongoid-slug (>= 4.0.0)
8
9
 
@@ -76,10 +77,12 @@ GEM
76
77
  nokogiri (>= 1.5.9)
77
78
  mail (2.6.3)
78
79
  mime-types (>= 1.16, < 3)
80
+ meta-tags (2.1.0)
81
+ actionpack (>= 3.0.0)
79
82
  mime-types (2.6.1)
80
83
  mini_portile (0.6.2)
81
84
  minitest (5.8.0)
82
- mongo (2.2.0)
85
+ mongo (2.2.1)
83
86
  bson (~> 4.0)
84
87
  mongoid (5.0.1)
85
88
  activemodel (~> 4.0)
@@ -3,26 +3,24 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
  require 'ants/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
- s.name = 'ants'
7
- s.version = Ants::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = [ 'Alexander Kravets' ]
10
- s.email = 'alex@slatestudio.com'
11
- s.license = 'MIT'
12
- s.homepage = 'https://github.com/slate-studio/ants'
13
- s.summary = 'Collection of concerns for Rails + Mongoid + Character web development'
14
- s.description = <<-DESC
15
- Collection of concerns and helpers for Rails + Mongoid + Character web development
16
- DESC
6
+ s.name = 'ants'
7
+ s.version = Ants::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = [ 'Alexander Kravets' ]
10
+ s.email = 'alex@slatestudio.com'
11
+ s.license = 'MIT'
12
+ s.homepage = 'https://github.com/slate-studio/ants'
13
+ s.summary = 'Collection of concerns and helpers for Rails + Mongoid + Character web development.'
17
14
 
18
15
  s.rubyforge_project = 'ants'
19
16
  s.files = `git ls-files`.split("\n")
20
17
  s.require_paths = [ 'lib' ]
21
18
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
22
19
 
23
- s.add_dependency('mongoid', '>= 4.0' )
20
+ s.add_dependency('mongoid', '>= 4.0')
24
21
  s.add_dependency('mongoid-slug', '>= 4.0.0')
25
22
  s.add_dependency('devise')
23
+ s.add_dependency('meta-tags')
26
24
 
27
25
  s.add_development_dependency('rails', [ '>= 4.2' ])
28
26
  s.add_development_dependency('rspec', [ '>= 2.0' ])
@@ -1,10 +1,11 @@
1
- require 'mongoid'
2
- require 'mongoid_slug'
3
- require 'devise'
1
+ require "mongoid"
2
+ require "mongoid_slug"
3
+ require "devise"
4
+ require "meta-tags"
4
5
 
5
6
  module Ants
6
- require 'ants/engine'
7
- require 'ants/routing'
7
+ require "ants/engine"
8
+ require "ants/routing"
8
9
  require "mongoid/fake_criteria"
9
10
  require "concerns/ants/id"
10
11
  require "concerns/ants/featurable"
@@ -1,3 +1,3 @@
1
1
  module Ants
2
- VERSION = "0.3.9"
2
+ VERSION = "0.3.10"
3
3
  end
@@ -49,7 +49,7 @@ module Ants
49
49
  def opengraph_image_url
50
50
  url = _opengraph_image_url.presence
51
51
  if url
52
- if !url.include?('//') && Rails.env.production?
52
+ if !url.include?('//')
53
53
  "#{protocole}#{host}#{url}"
54
54
  else
55
55
  url
@@ -62,11 +62,15 @@ module Ants
62
62
  protected
63
63
 
64
64
  def host
65
- @host ||= ENV.fetch("HOST")
65
+ @host ||= (Rails.env.production? ? ENV.fetch("HOST") : "")
66
66
  end
67
67
 
68
68
  def protocole
69
- @protocole ||= Rails.application.config.force_ssl ? "https://" : "http://"
69
+ if Rails.env.production?
70
+ @protocole ||= Rails.application.config.force_ssl ? "https://" : "http://"
71
+ else
72
+ @protocole ||= ""
73
+ end
70
74
  end
71
75
  end
72
76
  end
@@ -3,23 +3,18 @@ module Ants
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  def serializable_hash(options={})
6
-
7
6
  attrs = super(options)
8
7
 
9
8
  attrs.each_pair do |k, v|
10
-
11
9
  if k.end_with?('_id')
12
10
  attrs[k] = v.to_s
13
11
  end
14
-
15
12
  if k.end_with?('_ids')
16
13
  attrs[k] = attrs[k].collect { |id| id.to_s }
17
14
  end
18
-
19
15
  end
20
16
 
21
17
  return attrs
22
18
  end
23
-
24
19
  end
25
- end
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ants
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kravets
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: meta-tags
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rails
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -136,8 +150,7 @@ dependencies:
136
150
  - - "~>"
137
151
  - !ruby/object:Gem::Version
138
152
  version: '10.0'
139
- description: |
140
- Collection of concerns and helpers for Rails + Mongoid + Character web development
153
+ description:
141
154
  email: alex@slatestudio.com
142
155
  executables: []
143
156
  extensions: []
@@ -228,7 +241,7 @@ rubyforge_project: ants
228
241
  rubygems_version: 2.4.5.1
229
242
  signing_key:
230
243
  specification_version: 4
231
- summary: Collection of concerns for Rails + Mongoid + Character web development
244
+ summary: Collection of concerns and helpers for Rails + Mongoid + Character web development.
232
245
  test_files:
233
246
  - spec/mongoid/fake_criteria_spec.rb
234
247
  - spec/mongoid/sorted_relations_spec.rb