where_to 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/where_to/configuration.rb +14 -0
- data/lib/where_to/locator.rb +2 -3
- data/lib/where_to/version.rb +1 -1
- data/lib/where_to.rb +17 -1
- metadata +2 -2
- data/lib/where_to/format.yml +0 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDgzZmEwODdiY2JjY2E2M2VkNjIyNWFkNGExYTNhYzQwYjNjNmQ0NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDIwMzRjNjFkMGUxM2MwMDlhNWU1N2RkMTAzNWUxODEyNGRjZWJiZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2I1NzAxZjQwMTdmYWRkMDgxOWQ1YjVkMzNiOTU5NzZmZmI3NmIwMTM4ZTc4
|
10
|
+
MTVlNmM4NzgzYjMzOTUxMTY0YjExZjYwYTIyY2M5ZGQ1MTUzZmVhNzZkYWNj
|
11
|
+
Y2JmNjFjNWI2OTU5N2ZmZTMzMDExNmUyMzY1NTc5MmQxMTVhMTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NWVhYzNlYjk3YzI1MmRmNzc3ZWE5YzIxNWRkNTUxMTEzNDZkYmIzYTJjNzM3
|
14
|
+
MjRkMzQwNDZmODYyYTRhZDc1OWMwMGY0N2I4MWY5ZThiNjY0Y2RjMGZmYmI1
|
15
|
+
ZTAwYTQwNTUyMGM1MTViMDE3MDFmYmM5OWIzYThjMWI2ZWFkMGE=
|
data/lib/where_to/locator.rb
CHANGED
@@ -1,22 +1,21 @@
|
|
1
1
|
require 'where_to/location'
|
2
|
+
require 'where_to/configuration'
|
2
3
|
require 'yaml'
|
3
4
|
|
4
5
|
module WhereTo
|
5
6
|
class Locator
|
6
7
|
attr_accessor :series_title, :airdate, :season, :season_airdate
|
7
8
|
attr_accessor :episode_title, :episode_number, :episode_quality, :episode_extension
|
8
|
-
FORMAT_FILE = 'lib/where_to/format.yml'
|
9
9
|
|
10
10
|
def initialize(hash = {})
|
11
11
|
load_values_from hash
|
12
|
-
@format_file = YAML.load_file FORMAT_FILE
|
13
12
|
end
|
14
13
|
|
15
14
|
def locate(hash = {})
|
16
15
|
load_values_from hash
|
17
16
|
validate!
|
18
17
|
|
19
|
-
output =
|
18
|
+
output = WhereTo.configuration.folder_format
|
20
19
|
output.gsub! '%series_title', series_title
|
21
20
|
output.gsub! '%season_number', season.to_s
|
22
21
|
output.gsub! '%season_airdate', season_airdate.to_s
|
data/lib/where_to/version.rb
CHANGED
data/lib/where_to.rb
CHANGED
@@ -1,7 +1,23 @@
|
|
1
1
|
require 'where_to/version'
|
2
2
|
require 'where_to/locator'
|
3
3
|
require 'where_to/location'
|
4
|
+
require 'where_to/configuration'
|
4
5
|
|
5
6
|
module WhereTo
|
7
|
+
class << self
|
8
|
+
attr_accessor :configuration
|
9
|
+
end
|
6
10
|
|
7
|
-
|
11
|
+
def self.configuration
|
12
|
+
@configuration ||= Configuration.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.reset
|
16
|
+
@configuration = Configuration.new
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.configure
|
20
|
+
yield configuration
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: where_to
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Toniazzo
|
@@ -96,8 +96,8 @@ files:
|
|
96
96
|
- bin/console
|
97
97
|
- bin/setup
|
98
98
|
- lib/where_to.rb
|
99
|
+
- lib/where_to/configuration.rb
|
99
100
|
- lib/where_to/episode_formatter.rb
|
100
|
-
- lib/where_to/format.yml
|
101
101
|
- lib/where_to/location.rb
|
102
102
|
- lib/where_to/locator.rb
|
103
103
|
- lib/where_to/version.rb
|
data/lib/where_to/format.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
folder_format: "%series_title/Season %season_number (%season_airdate)/"
|