ongaku_ryoho_server 0.5.1 → 0.5.2

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: f602d4f4c2636375c55d96254285e61b6c6a785a
4
- data.tar.gz: e49ac7fd3e6e594ba9e787e43d7c6ecc7f34fe7c
3
+ metadata.gz: 420c159644d71253d839dc8c45539931e8fcc56f
4
+ data.tar.gz: 3bef5f4bc768e8f733c40da1e30cbdc3d210eb6c
5
5
  SHA512:
6
- metadata.gz: 92c0daffb408b9d566a72289e1133d5345fd0d021b255aa887420ee058178272a98474719aa0a6eafc4ec9401efbf1b39b63c83aa635ca20b50e8eb617a09ede
7
- data.tar.gz: f2ece7fe3c9ac856ab0ca2e0609fb16df610b593605dd5e69605cd272f58aeafb885f83f6e0ddaa037606360168e3d5b502903dffe65d1e13a0f0962dd480fc3
6
+ metadata.gz: 1e27cfd66fc816785430541ffbcb7cac4d18f6ac63ae9cee2dd67c3d555a326691913f3b5c05a45499cb60276755e8aa4c5283f623c2fe3fdda5de59e451bce5
7
+ data.tar.gz: ef5d506ba3b15ca20b0da83d3f6515ac6120cce540a8db432fdb71c00a804ea71d255fa84f8e23b9301bf15ceb4b4a65bcd7f02a5bd94a011da85cbed14d1848
data/history.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.5.2 / 2013-07-06
2
+
3
+ * use strings as keys for json, instead of symbols
4
+
5
+
1
6
  === 0.5.1 / 2013-07-04
2
7
 
3
8
  * enable cors
@@ -45,7 +45,7 @@ module OngakuRyohoServer
45
45
  other_file_list = Oj.load(other_file_list)
46
46
  else
47
47
  other_file_list = Oj.load(OngakuRyohoServer::List.get)
48
- other_file_list.map! { |obj| obj[:location] }
48
+ other_file_list.map! { |obj| obj["location"] }
49
49
  end
50
50
 
51
51
  # determine which files are missing and which are new
@@ -53,14 +53,12 @@ module OngakuRyohoServer
53
53
  new_files = other_file_list - file_list
54
54
 
55
55
  # process new files
56
- new_tracks = OngakuRyohoServer::Process.files(
57
- new_files, { :last_modified => Time.now }
58
- )
56
+ new_tracks = OngakuRyohoServer::Process.files(new_files)
59
57
 
60
58
  # return missing and new tracks
61
59
  return {
62
- :missing_files => missing_files,
63
- :new_tracks => new_tracks
60
+ "missing_files" => missing_files,
61
+ "new_tracks" => new_tracks
64
62
  }
65
63
  end
66
64
 
@@ -94,19 +92,19 @@ module OngakuRyohoServer
94
92
  tag = fileref.tag
95
93
 
96
94
  tags = {
97
- :title => tag.title,
98
- :artist => tag.artist,
99
- :album => tag.album,
100
- :year => tag.year,
101
- :track => tag.track,
102
- :genre => tag.genre
95
+ "title" => tag.title,
96
+ "artist" => tag.artist,
97
+ "album" => tag.album,
98
+ "year" => tag.year,
99
+ "track" => tag.track,
100
+ "genre" => tag.genre
103
101
  }
104
102
 
105
103
  tags.each do |key, value|
106
104
  tags[key] = "Unknown" if value.nil? or (value.respond_to?(:empty) and value.empty?)
107
105
  end
108
106
 
109
- tags.merge!({ :filename => filename, :location => location })
107
+ tags.merge!({ "filename" => filename, "location" => location })
110
108
 
111
109
  tags.each do |k, v|
112
110
  tags[k] = OngakuRyohoServer::Process.encode_string(v) if v.is_a? String
@@ -7,9 +7,9 @@ require "sinatra/cross_origin"
7
7
  require "uri"
8
8
  require "digest/sha1"
9
9
 
10
- require "ongaku_ryoho_server/process"
11
- require "ongaku_ryoho_server/list"
12
- require "ongaku_ryoho_server/application"
10
+ require "#{File.dirname(__FILE__)}/ongaku_ryoho_server/process"
11
+ require "#{File.dirname(__FILE__)}/ongaku_ryoho_server/list"
12
+ require "#{File.dirname(__FILE__)}/ongaku_ryoho_server/application"
13
13
 
14
14
 
15
15
  module OngakuRyohoServer
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "ongaku_ryoho_server"
5
- s.version = "0.5.1"
5
+ s.version = "0.5.2"
6
6
 
7
7
  s.authors = ["Steven Vandevelde"]
8
8
  s.email = ["icid.asset@gmail.com"]
@@ -40,12 +40,12 @@ describe "Application" do
40
40
  json = Oj.load(last_response.body)
41
41
  first_item = json.first
42
42
 
43
- first_item.has_key?(:title).must_equal true
44
- first_item.has_key?(:artist).must_equal true
45
- first_item.has_key?(:album).must_equal true
46
- first_item.has_key?(:year).must_equal true
47
- first_item.has_key?(:track).must_equal true
48
- first_item.has_key?(:genre).must_equal true
43
+ first_item.has_key?("title").must_equal true
44
+ first_item.has_key?("artist").must_equal true
45
+ first_item.has_key?("album").must_equal true
46
+ first_item.has_key?("year").must_equal true
47
+ first_item.has_key?("track").must_equal true
48
+ first_item.has_key?("genre").must_equal true
49
49
  end
50
50
  end
51
51
 
@@ -79,33 +79,33 @@ describe "Application" do
79
79
  it "should have 2 parent keys" do
80
80
  post "/check"
81
81
  json = Oj.load(last_response.body)
82
- json[:missing_files].must_be_kind_of Array
83
- json[:new_tracks].must_be_kind_of Array
82
+ json["missing_files"].must_be_kind_of Array
83
+ json["new_tracks"].must_be_kind_of Array
84
84
  end
85
85
 
86
86
  it "should have 3 new tracks when given empty file list" do
87
87
  post "/check", :file_list => Oj.dump([])
88
88
  json = Oj.load(last_response.body)
89
- json[:new_tracks].length.must_equal 3
89
+ json["new_tracks"].length.must_equal 3
90
90
  end
91
91
 
92
92
  it "should have 0 new tracks when given same file list" do
93
93
  file_list = [
94
- { :location => "spec/data/a.mp3" },
95
- { :location => "spec/data/b.mp3" },
96
- { :location => "spec/data/c.mp3" }
94
+ { "location" => "spec/data/a.mp3" },
95
+ { "location" => "spec/data/b.mp3" },
96
+ { "location" => "spec/data/c.mp3" }
97
97
  ]
98
98
 
99
99
  post "/check", :file_list => Oj.dump(file_list)
100
100
  json = Oj.load(last_response.body)
101
- json[:new_tracks].length.must_equal 3
101
+ json["new_tracks"].length.must_equal 3
102
102
  end
103
103
 
104
104
  it "should have 3 missing files" do
105
105
  file_list = [
106
- { :location => "spec/data/a.mp3" },
107
- { :location => "spec/data/b.mp3" },
108
- { :location => "spec/data/c.mp3" }
106
+ { "location" => "spec/data/a.mp3" },
107
+ { "location" => "spec/data/b.mp3" },
108
+ { "location" => "spec/data/c.mp3" }
109
109
  ]
110
110
 
111
111
  post "/check",
@@ -113,7 +113,7 @@ describe "Application" do
113
113
  :other_file_list => Oj.dump([])
114
114
 
115
115
  json = Oj.load(last_response.body)
116
- json[:missing_files].length.must_equal 3
116
+ json["missing_files"].length.must_equal 3
117
117
  end
118
118
  end
119
119
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ongaku_ryoho_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Vandevelde
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-04 00:00:00.000000000 Z
11
+ date: 2013-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj