transmission-rss 0.1.5 → 0.1.6

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.
@@ -140,9 +140,9 @@ client = Client.new(config.server.host, config.server.port)
140
140
  aggregator.feeds.concat(config.feeds)
141
141
 
142
142
  # Callback for a new item on one of the feeds.
143
- aggregator.on_new_item do |torrentFile|
143
+ aggregator.on_new_item do |torrent_file|
144
144
  Thread.start do
145
- client.addTorrent(torrentFile, config.add_paused)
145
+ client.add_torrent(torrent_file, config.add_paused)
146
146
  end
147
147
  end
148
148
 
@@ -1,7 +1,7 @@
1
1
  $:.unshift(File.dirname(__FILE__))
2
2
 
3
3
  module TransmissionRSS
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
6
6
 
7
7
  dir = 'transmission-rss'
@@ -3,7 +3,7 @@ require 'json'
3
3
  require 'timeout'
4
4
 
5
5
  # TODO
6
- # * Why the hell do timeouts in getSessionID and addTorrent not work?!
6
+ # * Why the hell do timeouts in get_session_id and add_torrent not work?!
7
7
 
8
8
  # Class for communication with transmission utilizing the RPC web interface.
9
9
  class TransmissionRSS::Client
@@ -15,7 +15,7 @@ class TransmissionRSS::Client
15
15
  end
16
16
 
17
17
  # Get transmission session id by simple GET.
18
- def getSessionID
18
+ def get_session_id
19
19
  get = Net::HTTP::Get.new(
20
20
  '/transmission/rpc'
21
21
  )
@@ -46,12 +46,12 @@ class TransmissionRSS::Client
46
46
  end
47
47
 
48
48
  # POST json packed torrent add command.
49
- def addTorrent(torrentFile, paused = false)
49
+ def add_torrent(torrent_file, paused = false)
50
50
  post = Net::HTTP::Post.new(
51
51
  '/transmission/rpc',
52
52
  initheader = {
53
53
  'Content-Type' => 'application/json',
54
- 'X-Transmission-Session-Id' => getSessionID
54
+ 'X-Transmission-Session-Id' => get_session_id
55
55
  }
56
56
  )
57
57
 
@@ -59,7 +59,7 @@ class TransmissionRSS::Client
59
59
  "method" => "torrent-add",
60
60
  "arguments" => {
61
61
  "paused" => paused,
62
- "filename" => torrentFile
62
+ "filename" => torrent_file
63
63
  }
64
64
  }.to_json
65
65
 
@@ -83,6 +83,6 @@ class TransmissionRSS::Client
83
83
 
84
84
  result = JSON.parse(response.body).result
85
85
 
86
- @log.debug('addTorrent result: ' + result)
86
+ @log.debug('add_torrent result: ' + result)
87
87
  end
88
88
  end
@@ -16,8 +16,8 @@ class TransmissionRSS::ConfigEditor
16
16
  }
17
17
 
18
18
  # Loads glade file and initializes dynamic GUI elements.
19
- def initialize(configFile, config)
20
- @configFile = configFile
19
+ def initialize(config_file, config)
20
+ @configFile = config_file
21
21
  @config = config
22
22
 
23
23
  path = File.join(File.dirname(__FILE__), 'main.glade')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - henning mueller