music_ids 0.3.2 → 0.3.3

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: d075e77c1c9c168a277ebbe0f9c4cd56742f86eb
4
- data.tar.gz: 9798bab45ac443c338230e84bad99fc3b3d4b102
3
+ metadata.gz: 22286ceddecf6098863e6459e55d3bb7367e2ffc
4
+ data.tar.gz: 1be8da113d0544deab68d16c24c6d5ce7c8c5d8a
5
5
  SHA512:
6
- metadata.gz: f46dcd3fb1756625c484f3b3eba6b525137a13a085f11fc2750745824c49ada705ca945e3bad4042b95c0a1de19c8bea17fa9319546566bd6d0d23245ada1359
7
- data.tar.gz: 60c280f55d3515da25fe9eb878ff73040c65aaab86d70a716f8512b8aefc64e48c499477ce6fbb89a5405f8a69e79388afeadf2f608647624344ddfc66270277
6
+ metadata.gz: 4b15a0fb90d6e058dcc393d2c6eeecaddde5b788a8c43d23af6ed6f71f1bbc6106da2d5f43ae20d009aff6b08228907fea07678fdcc8a3a7c2fc659efc0201d2
7
+ data.tar.gz: 0b2479bed3a4db34a674beb82dbf2d7881d0fbc532926a61b4429b934542cb5b4fa658f0752804da2398eacea21f3e24590462c170d8842a9f05a085f6a62c5d
data/.travis.yml CHANGED
@@ -1,3 +1,9 @@
1
+ sudo: false
1
2
  language: ruby
2
3
  rvm:
3
4
  - 2.2.2
5
+ - 2.1.6
6
+ - 2.0.0
7
+ - 1.9.3
8
+ - jruby-19mode
9
+ cache: bundler
data/README.md CHANGED
@@ -73,6 +73,23 @@ grid.as(:prefixed) #=> 'GRID:A1-2425G-ABC1234002-M'
73
73
  MusicIds::GRid.parse(grid) == grid #=> true
74
74
  ```
75
75
 
76
+ Support for `as_json` is included so the basic JSON generation case will work:
77
+
78
+ ```ruby
79
+ require 'music_ids'
80
+ require 'json'
81
+
82
+
83
+ isrc = MusicIds::ISRC.parse('FRZ039800212')
84
+ grid = MusicIds::GRid.parse('A12425GABC1234002M')
85
+
86
+ isrc.as_json #=> 'FRZ039800212'
87
+ grid.as_json #=> 'A12425GABC1234002M'
88
+
89
+ JSON.generate({isrc: isrc, grid: grid})
90
+ #=> "{\"isrc\":\"FRZ039800212\",\"grid\":\"A12425GABC1234002M\"}"
91
+ ```
92
+
76
93
  ## Development
77
94
  After checking out the repo, run `bin/setup` to install dependencies. Then, run
78
95
  `bin/console` for an interactive prompt that will allow you to experiment.
data/lib/music_ids/id.rb CHANGED
@@ -94,6 +94,10 @@ module MusicIds
94
94
  self.class.prefix
95
95
  end
96
96
 
97
+ def as_json(*)
98
+ to_s
99
+ end
100
+
97
101
  private
98
102
 
99
103
  def fetch(ivar)
@@ -1,3 +1,3 @@
1
1
  module MusicIds
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
data/music_ids.gemspec CHANGED
@@ -21,7 +21,7 @@ There are often several ways that these IDs can be written, so the classes provi
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.9"
24
+ spec.add_development_dependency "bundler", "~> 1.7"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  spec.add_development_dependency "rspec", "~> 3"
27
27
  spec.add_development_dependency "yard"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: music_ids
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Patterson
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
19
+ version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.9'
26
+ version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement