gdshowsdb 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/data/gdshowsdb/1969.yaml +4307 -805
- data/data/gdshowsdb/1971.yaml +859 -10
- data/data/gdshowsdb/1990.yaml +0 -7
- data/data/gdshowsdb/1994.yaml +64 -1
- data/data/gdshowsdb/song_refs.yaml +28 -0
- data/deadlists_parser.rb +356 -0
- data/lib/gdshowsdb.rb +12 -2
- data/lib/gdshowsdb/models/song.rb +1 -0
- data/lib/gdshowsdb/show_db_extractor.rb +1 -1
- data/lib/gdshowsdb/song_ref_db_extractror.rb +1 -1
- data/lib/gdshowsdb/templates/update_migration.rb.erb +1 -1
- data/lib/gdshowsdb/version.rb +1 -1
- metadata +4 -3
data/lib/gdshowsdb.rb
CHANGED
@@ -23,15 +23,25 @@ module Gdshowsdb
|
|
23
23
|
|
24
24
|
def self.load(level = nil)
|
25
25
|
ActiveRecord::Migrator.up File.dirname(__FILE__) + '/gdshowsdb/db/migrations', level
|
26
|
-
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.yaml_file_location(file_name)
|
29
|
+
Gem.loaded_specs['gdshowsdb'].full_gem_path + "/data/gdshowsdb/#{file_name}"
|
30
|
+
end
|
27
31
|
|
28
32
|
def self.load_yaml(file_name)
|
29
|
-
YAML.load_file(
|
33
|
+
YAML.load_file(yaml_file_location(file_name))
|
30
34
|
end
|
31
35
|
|
32
36
|
def self.load_yaml_for_year(year)
|
33
37
|
load_yaml("#{year}.yaml")
|
34
38
|
end
|
39
|
+
|
40
|
+
def self.write_yaml(file_name, data)
|
41
|
+
File.open(yaml_file_location(file_name), "w") do |file|
|
42
|
+
file.write data.to_yaml
|
43
|
+
end
|
44
|
+
end
|
35
45
|
end
|
36
46
|
|
37
47
|
class Hash
|
@@ -14,6 +14,7 @@ class Song < ActiveRecord::Base
|
|
14
14
|
|
15
15
|
def self.create_song_relationships(spec)
|
16
16
|
song_ref = SongRef.find_by_name(spec[:name])
|
17
|
+
raise "Unable to find a song ref named #{spec[:name]} #{spec.inspect}" unless song_ref
|
17
18
|
song_ref.songs << Song.find_by_uuid(spec[:uuid])
|
18
19
|
song_ref.song_occurences << SongOccurence.create_from(uuid: SecureRandom.uuid, position: spec[:position], show_set_uuid: spec[:show_set_uuid])
|
19
20
|
song_ref.save
|
data/lib/gdshowsdb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gdshowsdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- data/gdshowsdb/1995.yaml
|
87
87
|
- data/gdshowsdb/shows-debug.yaml
|
88
88
|
- data/gdshowsdb/song_refs.yaml
|
89
|
+
- deadlists_parser.rb
|
89
90
|
- gdshowsdb.gemspec
|
90
91
|
- lib/gdshowsdb.rb
|
91
92
|
- lib/gdshowsdb/db/migrations/001_create_song_ref_table.rb
|
@@ -152,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
153
|
version: '0'
|
153
154
|
requirements: []
|
154
155
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.6.
|
156
|
+
rubygems_version: 2.6.14
|
156
157
|
signing_key:
|
157
158
|
specification_version: 4
|
158
159
|
summary: All Grateful Dead show information in a relational database.
|