heywatch 1.2.3 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/heywatch +5 -1
  3. data/lib/heywatch.rb +6 -2
  4. metadata +48 -60
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 88acc7808a95b83063b2cd2f6b3816578d082417
4
+ data.tar.gz: 0ebd457351dc7673119f26ecf097c1a0cb2db8ee
5
+ SHA512:
6
+ metadata.gz: 284115a117965d1e9ed5e863040f1d1be5cf366c610295c3d2f36f091d9585fc08b5a60e9a2632d031ab6b67ecf590fab88ea2576ba3c2b8f6d75b387e2a20a8
7
+ data.tar.gz: 54d9f7487156a38f3998527eab728612774a1188c6c168346a2af08c75dbd5a5fe44bbdb6d0ef88a42ee297549a8abff1802d75cdf5c2b69d1ac6b2e5ed2e0ed
@@ -121,11 +121,15 @@ begin
121
121
  if resource == "account"
122
122
  puts JSON.pretty_generate(HeyWatch.register(params))
123
123
  else
124
+ if resource == "robot/job" # read from STDIN
125
+ params = $stdin.read
126
+ end
127
+
124
128
  res = hw.send(method, *[resource, params])
125
129
  if res.empty?
126
130
  puts "ok"
127
131
  else
128
- puts JSON.pretty_generate(hw.send(method, *[resource, params]))
132
+ puts JSON.pretty_generate(res)
129
133
  end
130
134
  end
131
135
  exit
@@ -1,19 +1,23 @@
1
1
  require "rest-client"
2
2
  require "json"
3
+ require "uri"
3
4
 
4
5
  class HeyWatch
5
6
  class InvalidResource < ArgumentError; end
6
7
  class BadRequest < RuntimeError; end
7
8
 
8
9
  URL = ENV["HEYWATCH_URL"] || "https://heywatch.com"
9
- VERSION = "1.2.1"
10
+ VERSION = "1.2.6"
10
11
 
11
12
  attr_reader :credits_left
12
13
 
13
14
  # Authenticate with your HeyWatch credentials
14
15
  #
15
16
  # hw = HeyWatch.new(user, passwd)
16
- def initialize(user, password)
17
+ def initialize(user=nil, password=nil)
18
+ uri = URI.parse(URL)
19
+ user = uri.user if !uri.user.nil?
20
+ password = uri.password if !uri.password.nil?
17
21
  @cli = RestClient::Resource.new(URL, {:user => user, :password => password, :headers =>
18
22
  {:user_agent => "HeyWatch Ruby/#{VERSION}", :accept => "application/json"}})
19
23
 
metadata CHANGED
@@ -1,86 +1,74 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: heywatch
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 2
8
- - 3
9
- version: 1.2.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.6
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Bruno Celeste
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2013-05-21 00:00:00 +02:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2013-10-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: rest-client
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- version: "0"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
30
20
  type: :runtime
31
- version_requirements: *id001
32
- - !ruby/object:Gem::Dependency
33
- name: json
34
21
  prerelease: false
35
- requirement: &id002 !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- segments:
40
- - 0
41
- version: "0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
42
34
  type: :runtime
43
- version_requirements: *id002
44
- description: Client Library for encoding Videos with HeyWatch, a Video Encoding Web Service.
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Client Library for encoding Videos with HeyWatch, a Video Encoding Web
42
+ Service.
45
43
  email: bruno@particle-s.com
46
- executables:
44
+ executables:
47
45
  - heywatch
48
46
  extensions: []
49
-
50
47
  extra_rdoc_files: []
51
-
52
- files:
48
+ files:
53
49
  - lib/heywatch.rb
54
50
  - bin/heywatch
55
- has_rdoc: true
56
51
  homepage: http://www.heywatchencoding.com
57
52
  licenses: []
58
-
53
+ metadata: {}
59
54
  post_install_message:
60
55
  rdoc_options: []
61
-
62
- require_paths:
56
+ require_paths:
63
57
  - lib
64
- required_ruby_version: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- segments:
69
- - 0
70
- version: "0"
71
- required_rubygems_version: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- segments:
76
- - 0
77
- version: "0"
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
78
68
  requirements: []
79
-
80
69
  rubyforge_project:
81
- rubygems_version: 1.3.6
70
+ rubygems_version: 2.0.5
82
71
  signing_key:
83
- specification_version: 3
72
+ specification_version: 4
84
73
  summary: Client library and CLI to encode videos with HeyWatch
85
74
  test_files: []
86
-