saber 1.2.0 → 1.2.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.
@@ -1,9 +1,3 @@
1
- PATH
2
- remote: /home/guten/dev/one/pa
3
- specs:
4
- pa (1.3.3)
5
- pd
6
-
7
1
  GEM
8
2
  remote: https://rubygems.org/
9
3
  specs:
@@ -72,6 +66,8 @@ GEM
72
66
  optimism (3.3.1)
73
67
  json
74
68
  pd
69
+ pa (1.3.3)
70
+ pd
75
71
  pd (1.1.0)
76
72
  pry (0.9.10)
77
73
  coderay (~> 1.0.5)
@@ -122,24 +118,24 @@ PLATFORMS
122
118
 
123
119
  DEPENDENCIES
124
120
  blather (~> 0.8.0)
125
- faraday
126
- faraday_middleware
121
+ faraday (~> 0.8.4)
122
+ faraday_middleware (~> 0.8.8)
127
123
  guard
128
124
  guard-rspec
129
125
  highline (~> 1.6.14)
130
- isbn
126
+ isbn (~> 2.0.7)
131
127
  mechanize (~> 2.5.1)
132
128
  net-ssh (~> 2.5.2)
133
129
  optimism (~> 3.3.1)
134
- pa!
130
+ pa (~> 1.3.3)
135
131
  pd
136
132
  rb-inotify
137
133
  retort (~> 0.0.6)
138
134
  reverse_markdown (~> 0.3.0)
139
135
  rspec
140
- sys-filesystem
136
+ sys-filesystem (~> 1.0.0)
141
137
  tagen (~> 2.0.1)
142
138
  thor (~> 0.16.0)
143
139
  vcr
144
- watir
140
+ watir (~> 4.0.1)
145
141
  webmock
data/README.md CHANGED
@@ -116,7 +116,8 @@ Clean up unseeded files in rtorrent.
116
116
 
117
117
  $ saber clean
118
118
 
119
- use `saber help` to list all tasks.
119
+
120
+ Use `saber help` to list all tasks. use `saber help upload` to find specific task help.
120
121
 
121
122
  Install
122
123
  -------
@@ -0,0 +1,3 @@
1
+ #!/bin/zsh
2
+
3
+ time ../bin/1saber >/dev/null
@@ -1,10 +1,8 @@
1
1
  require "pd"
2
2
  require "pa"
3
3
  require "optimism"
4
- require "active_support/core_ext/module/attribute_accessors"
5
- require "active_support/concern"
6
- require "active_support/core_ext/numeric/bytes"
7
4
  require "saber/core_ext"
5
+ require "active_support/core_ext/numeric/bytes"
8
6
 
9
7
  module Saber
10
8
  autoload :VERSION, "saber/version"
@@ -21,7 +19,6 @@ module Saber
21
19
  FatalError = Class.new Exception
22
20
  Rc = Optimism.require "saber/rc", "~/.saberrc"
23
21
 
24
-
25
22
  class << self
26
23
  attr_accessor :ui
27
24
 
@@ -1,3 +1,5 @@
1
+ require "active_support/core_ext/module/attribute_accessors"
2
+
1
3
  module Saber
2
4
  # Usage
3
5
  #
@@ -14,12 +16,6 @@ module Saber
14
16
  #
15
17
  # Task.hello_world(1, 2) -> [1, 2]
16
18
  module Task
17
- autoload :Base, "saber/task/base"
18
- autoload :Clean, "saber/task/clean"
19
- autoload :Make, "saber/task/make"
20
- autoload :Upload, "saber/task/upload"
21
- autoload :FindUploads, "saber/task/find_uploads"
22
-
23
19
  @@tasks = {}
24
20
 
25
21
  # a list of all tasks
@@ -27,10 +23,14 @@ module Saber
27
23
 
28
24
  class << self
29
25
  def [](name)
30
- require "saber/task/#{name}"
31
-
32
26
  tasks[name]
33
27
  end
34
28
  end
35
29
  end
36
30
  end
31
+
32
+ require "saber/task/base"
33
+ require "saber/task/clean"
34
+ require "saber/task/make"
35
+ require "saber/task/upload"
36
+ require "saber/task/find_uploads"
@@ -3,6 +3,7 @@ require "saber/mechanize_ext"
3
3
  require "highline/import"
4
4
  require "reverse_markdown"
5
5
  require "json"
6
+ require "active_support/core_ext/module/attribute_accessors"
6
7
 
7
8
  module Saber
8
9
  # Usage
@@ -1,3 +1,5 @@
1
+ require "tagen/core/io"
2
+
1
3
  module Saber
2
4
  module Tracker
3
5
  class CHD < Base
@@ -132,7 +132,7 @@ module Saber
132
132
  }
133
133
  }
134
134
 
135
- def do_upload(file, info)
135
+ def new_upload(info)
136
136
  info[:complete] = (info[:type] == "Pack")
137
137
 
138
138
  agent.goto "#{BASE_URL}/upload/#{info[:upload_type2]}"
@@ -148,7 +148,7 @@ module Saber
148
148
 
149
149
  if agent.url =~ %r~/upload/#{info[:upload_type2]}~
150
150
  err = agent.element(xpath: "//*[@id='formerrorlist']")
151
- msg = err.exists? ? ReverseMarkdown.parse(err) : agent.text
151
+ msg = err.exists? ? ReverseMarkdown.parse(err.html) : agent.text
152
152
  Saber.ui.error "ERROR: #{msg.to_s.strip}\n"
153
153
  return false
154
154
  else
@@ -3,7 +3,7 @@ module Saber
3
3
  class Gazelle < Base
4
4
  def add_format(info)
5
5
  unless info[:groupid]
6
- Saber.ui.error "You must provide groupid."
6
+ Saber.ui.error "You must provide a groupid -- #{info[:groupid].inspect}"
7
7
  return false
8
8
  end
9
9
 
@@ -15,12 +15,9 @@ module Saber
15
15
  form.submit() unless options["dry-run"]
16
16
 
17
17
  if agent.url =~ %r~/upload\.php~
18
- begin
19
- error = agent.element(xpath: "//*[@id='content']/div[2]/p[2]").html
20
- rescue Watir::Exception::UnknownObjectException # unable to locate element
21
- end
22
- error = ReverseMarkdown.parse(error) if error
23
- Saber.ui.error "ERROR: #{error.to_s.strip}\n"
18
+ err = agent.element(xpath: "//*[@id='content']/div[2]/p[2]")
19
+ msg = err.exists? ? ReverseMarkdown.parse(err.html).strip : ""
20
+ Saber.ui.error "ERROR: #{msg}\n"
24
21
  return false
25
22
  else
26
23
  return true
@@ -36,12 +33,9 @@ module Saber
36
33
  form.submit() unless options["dry-run"]
37
34
 
38
35
  if agent.url =~ %r~/upload\.php~
39
- begin
40
- error = agent.element(xpath: "//*[@id='content']/div[2]/p[2]").html
41
- rescue Watir::Exception::UnknownObjectException # unable to locate element
42
- end
43
- error = ReverseMarkdown.parse(error) if error
44
- Saber.ui.error "ERROR: #{error.to_s.strip}\n"
36
+ err = agent.element(xpath: "//*[@id='content']/div[2]/p[2]")
37
+ msg = err.exists? ? ReverseMarkdown.parse(err.html).strip : ""
38
+ Saber.ui.error "ERROR: #{msg}\n"
45
39
  return false
46
40
  else
47
41
  return true
@@ -1,3 +1,3 @@
1
1
  module Saber
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -0,0 +1,2 @@
1
+ require "spec_helper"
2
+ require "saber/tracker2"
@@ -0,0 +1,2 @@
1
+ require "spec_helper"
2
+ require "saber/tracker"
@@ -1,7 +1,16 @@
1
1
  require "pd"
2
- require "saber"
3
2
  require "logger"
4
3
 
4
+ require "saber"
5
+ require "saber/cli"
6
+ require "saber/ui"
7
+ require "saber/task"
8
+ require "saber/fetcher"
9
+ require "saber/autofetcher"
10
+ require "saber/tracker2"
11
+ require "saber/tracker"
12
+ require "saber/book"
13
+
5
14
  $spec_dir = File.expand_path("..", __FILE__)
6
15
  $spec_data = File.join($spec_dir, "data")
7
16
  $spec_tmp = File.join($spec_dir, "tmp")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-01 00:00:00.000000000 Z
12
+ date: 2012-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pd
@@ -289,6 +289,7 @@ files:
289
289
  - README.md
290
290
  - Ragfile
291
291
  - Rakefile
292
+ - benchmark/a.sh
292
293
  - bin/1saber
293
294
  - bin/saber
294
295
  - bin/saber-drb_add
@@ -354,6 +355,8 @@ files:
354
355
  - spec/saber/fetcher_spec.rb
355
356
  - spec/saber/task_spec.rb
356
357
  - spec/saber/tracker/bib_spec.rb
358
+ - spec/saber/tracker2_spec.rb
359
+ - spec/saber/tracker_spec.rb
357
360
  - spec/spec_helper.rb
358
361
  - systemd/saber-chd@.service
359
362
  - systemd/saber-client@.service