serienrenamer 0.0.16 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5868c58d8665caa167ed5a824b66540729958146
4
+ data.tar.gz: ab004cc07646c49f237ad98c71084a7184fca572
5
+ SHA512:
6
+ metadata.gz: 09a725c2842db8f435b051c9deb9d187df90a98f4dce59ddc2cad4ec1ef3d6214120de4de2fb0a5da215be9955d8236717b52444b05015500c224bcaed7d00e4
7
+ data.tar.gz: c6745367be6ce945fa2108a914aed5146b3cebbfbd92e21aa020aee4c554136015e866095236243a546ec5ec0d3403825b27ecbcf257ae86e0f183e5e2be5a7f
data/bin/serienrenamer CHANGED
@@ -21,10 +21,11 @@ FileUtils.mkdir(CONFIG_DIR) unless File.directory?(CONFIG_DIR)
21
21
  # configuration
22
22
  STANDARD_CONFIG = {
23
23
  :default_directory => File.join(File.expand_path("~"), "Downloads"),
24
- :store_episode_info => false,
24
+ :store_episode_info => true,
25
25
  :store_path => File.join(CONFIG_DIR, "information_storage.yml"),
26
26
  :byte_count_for_md5 => 2048,
27
27
  :illegal_words => %w{ ML },
28
+ :disabled_plugins => %w{ NOT_REALLY_A_PLUGIN },
28
29
  }
29
30
 
30
31
  config = STANDARD_CONFIG.merge_with_serialized(CONFIG_FILE)
@@ -84,10 +85,21 @@ opts.separator("")
84
85
 
85
86
  rest = opts.permute(ARGV)
86
87
 
87
- Serienrenamer::Pluginbase.registered_plugins.sort! {|x,y| y.priority <=> x.priority }
88
+ ####
89
+ # get all plugins, reject disbled plugins and order them by their priority
90
+ registered_plugins = Serienrenamer::Pluginbase.registered_plugins
91
+
92
+ registered_plugins.reject! { |plugin|
93
+ config[:disabled_plugins].include? plugin.to_s || ! plugin.usable }
94
+
95
+ if options[:plugin] # only leave the wanted plugin
96
+ registered_plugins.reject! { |plugin| plugin.to_s !~ /#{options[:plugin]}/i }
97
+ end
98
+
99
+ registered_plugins.sort! {|x,y| y.priority <=> x.priority }
100
+
101
+ puts "Plugins loaded: #{registered_plugins.inspect}\n\n"
88
102
 
89
- puts "Plugins loaded: #{Serienrenamer::Pluginbase.registered_plugins.inspect}"
90
- puts ""
91
103
 
92
104
  # change into DIR
93
105
  episode_directory = rest.pop || config[:default_directory]
@@ -128,13 +140,7 @@ begin
128
140
  # if episodename is empty than query plugins
129
141
  if epi.episodename.match(/\w+/).nil? || options[:ignore_filenamedata]
130
142
 
131
- Serienrenamer::Pluginbase.registered_plugins.each do |plugin|
132
- # skip plugins that are not feasable
133
- next unless plugin.usable
134
- next unless plugin.respond_to?(:generate_episode_information)
135
- if options[:plugin]
136
- next unless plugin.plugin_name.match(/#{options[:plugin]}/i)
137
- end
143
+ registered_plugins.each do |plugin|
138
144
 
139
145
  # configure cleanup
140
146
  clean_data, extract_seriesname = false, false
@@ -150,10 +156,13 @@ begin
150
156
  extract_seriesname = false if options[:series]
151
157
 
152
158
  # ask plugin for information
159
+ print "\rAsking '#{ plugin }' for episode information #{' ' * 10}"
160
+ $stdout.flush
161
+
153
162
  epiname = plugin.generate_episode_information(epi)[0]
154
163
  next if epiname == nil
155
164
 
156
- puts "[#{plugin.plugin_name}] - #{epiname}"
165
+ puts "\n[#{plugin.plugin_name}] - #{epiname}"
157
166
 
158
167
  epi.add_episode_information(epiname, clean_data, extract_seriesname)
159
168
  next unless epi.episodename.match(/\w+/)
@@ -166,9 +175,8 @@ begin
166
175
 
167
176
  print "Filename okay ([jy]/n): "
168
177
  char = get_character
169
- print char.chr
170
178
 
171
- unless char.chr.match(/[jy\r]/i)
179
+ unless char.chr.match(/[jy\r\n]/i)
172
180
  puts "\nwill be skipped ...\n\n"
173
181
  next
174
182
  end
@@ -17,6 +17,11 @@ module Serienrenamer
17
17
  def self.to_s
18
18
  self.plugin_name
19
19
  end
20
+
21
+ # Is required because Ruby 2.0 prints the whole fully qualified class name
22
+ def self.inspect
23
+ return self.to_s
24
+ end
20
25
  end
21
26
 
22
27
  # include all existing plugins
@@ -1,3 +1,3 @@
1
1
  module Serienrenamer
2
- VERSION = '0.0.16'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,36 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serienrenamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Philipp Böhm
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-28 00:00:00.000000000 Z
11
+ date: 2013-05-08 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: wlapi
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.8.4
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 0.8.4
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: savon
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,65 +41,57 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: mediawiki-gateway
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: 0.4.4
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: 0.4.4
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: mechanize
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '2.3'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '2.3'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: highline
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: 1.6.11
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: 1.6.11
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: hashconfig
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: 0.0.1
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: 0.0.1
110
97
  description: Ruby Script that brings your series into an appropriate format like \"S01E01
@@ -135,6 +122,7 @@ files:
135
122
  - lib/serienrenamer/version.rb
136
123
  - serienrenamer.gemspec
137
124
  - test/serienjunkies_feed_sample.xml
125
+ - test/skipped_test_plugin_serienjunkies_org.rb
138
126
  - test/skipped_test_plugin_wikipedia.rb
139
127
  - test/test_episode.rb
140
128
  - test/test_helper.rb
@@ -142,38 +130,34 @@ files:
142
130
  - test/test_plugin_episode_identifier.rb
143
131
  - test/test_plugin_serienjunkies_de.rb
144
132
  - test/test_plugin_serienjunkies_feed.rb
145
- - test/test_plugin_serienjunkies_org.rb
146
133
  - test/test_plugin_textfile.rb
147
134
  homepage: http://github.com/pboehm/serienrenamer
148
135
  licenses: []
136
+ metadata: {}
149
137
  post_install_message:
150
138
  rdoc_options: []
151
139
  require_paths:
152
140
  - lib
153
141
  required_ruby_version: !ruby/object:Gem::Requirement
154
- none: false
155
142
  requirements:
156
- - - ! '>='
143
+ - - '>='
157
144
  - !ruby/object:Gem::Version
158
145
  version: 1.9.0
159
146
  required_rubygems_version: !ruby/object:Gem::Requirement
160
- none: false
161
147
  requirements:
162
- - - ! '>='
148
+ - - '>='
163
149
  - !ruby/object:Gem::Version
164
150
  version: '0'
165
- segments:
166
- - 0
167
- hash: 190241555
168
151
  requirements: []
169
152
  rubyforge_project:
170
- rubygems_version: 1.8.25
153
+ rubygems_version: 2.0.3
171
154
  signing_key:
172
- specification_version: 3
155
+ specification_version: 4
173
156
  summary: Ruby Script that brings your series into an appropriate format like \"S01E01
174
157
  - Episodename.avi\"
175
158
  test_files:
176
159
  - test/serienjunkies_feed_sample.xml
160
+ - test/skipped_test_plugin_serienjunkies_org.rb
177
161
  - test/skipped_test_plugin_wikipedia.rb
178
162
  - test/test_episode.rb
179
163
  - test/test_helper.rb
@@ -181,5 +165,4 @@ test_files:
181
165
  - test/test_plugin_episode_identifier.rb
182
166
  - test/test_plugin_serienjunkies_de.rb
183
167
  - test/test_plugin_serienjunkies_feed.rb
184
- - test/test_plugin_serienjunkies_org.rb
185
168
  - test/test_plugin_textfile.rb