schema_dot_org 1.5.2 → 1.6.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
  SHA256:
3
- metadata.gz: bd06f63bab8bdf86591dd9101189c2d0931dabb3029e3218caac1d61b069f111
4
- data.tar.gz: c4d569c0329ff3edfa2718ceee94ddae276f67014bf814e2bffa1fdc4ae08fbd
3
+ metadata.gz: fd1688fe2c05954777862ee6727412e86f56f91eb8383336a030fd5b78b944bd
4
+ data.tar.gz: d0dc0588f96446bae7b871ba526170e310fb9d4b07e4169efa36de3b5c600afa
5
5
  SHA512:
6
- metadata.gz: 6bba0dc7a060bed0c9a837cf79d03947935f1faa054b36863a06e562f1b87a9e7593a036e6c6b99745670e977fcef99dd238cbdbf2dee89696607e5a88605a07
7
- data.tar.gz: 815041c8864849c31b06d0a31c6aad4239bb0c4eb26d428b345da95116f4f3eb24d6594d5c35b643af652691ab0b4b1f4404bf65aa575f5eeb7e7c040768da52
6
+ metadata.gz: '052544928aaa4d5834b4d8e172d1a774fc2f1ae15c8f71d96c76f74f3f562f22e1e7c9239e09aa321cdbc78eba2ad5aa7d771f34e5c0fd63efd6801f9af6121b'
7
+ data.tar.gz: 34dbf599ececf0079537134688de5cb92d362e7c9bb473016da708f764d6818b5eeffc4350b7d67d647e633425741045b26297660ae5e31d96f7f8b7fe763dbf
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- schema_dot_org (1.5.1)
4
+ schema_dot_org (1.6.0)
5
5
  validated_object (~> 2.0.2)
6
6
 
7
7
  GEM
@@ -49,4 +49,4 @@ DEPENDENCIES
49
49
  schema_dot_org!
50
50
 
51
51
  BUNDLED WITH
52
- 1.16.1
52
+ 1.16.2
@@ -13,7 +13,7 @@ module SchemaDotOrg
13
13
 
14
14
 
15
15
  def to_s
16
- json_string = to_json_ld(pretty: true)
16
+ json_string = to_json_ld(pretty: (!rails_production? && !ENV['SCHEMA_DOT_ORG_MINIFIED_JSON']))
17
17
 
18
18
  # Mark as safe if we're in Rails
19
19
  if json_string.respond_to?(:html_safe)
@@ -57,5 +57,12 @@ module SchemaDotOrg
57
57
  self.class.name =~ UNQUALIFIED_CLASS_NAME_REGEX
58
58
  Regexp.last_match(1)
59
59
  end
60
+
61
+
62
+ private
63
+
64
+ def rails_production?
65
+ defined?(Rails) && Rails.env.production?
66
+ end
60
67
  end
61
68
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "schema_dot_org"
7
- spec.version = '1.5.2'
7
+ spec.version = '1.6.0'
8
8
  spec.authors = ["Robb Shecter"]
9
9
  spec.email = ["robb@public.law"]
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_dot_org
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robb Shecter
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-21 00:00:00.000000000 Z
11
+ date: 2018-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: validated_object
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.7.6
116
+ rubygems_version: 2.7.7
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: JSON-LD generator for Schema.org vocabulary