enigmamachine 0.3.2 → 0.3.3
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.
- data/README.rdoc +16 -11
- data/VERSION +1 -1
- data/enigmamachine.gemspec +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -69,28 +69,33 @@ Programmatic requests in Ruby might look something like this:
|
|
69
69
|
# enigma_client.rb:
|
70
70
|
|
71
71
|
require 'rubygems'
|
72
|
-
require '
|
73
|
-
require 'net/http'
|
74
|
-
require 'uri'
|
72
|
+
require 'httparty'
|
75
73
|
|
76
74
|
class EnigmaClient
|
77
75
|
|
76
|
+
include HTTParty
|
77
|
+
|
78
|
+
base_uri "localhost:2002"
|
79
|
+
|
78
80
|
def initialize (u, p)
|
79
|
-
@
|
81
|
+
@auth = encode_credentials(u, p)
|
80
82
|
end
|
81
83
|
|
82
84
|
def post(path_to_video, encoder_id)
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
85
|
+
self.class.post("/videos", {
|
86
|
+
:body => {:video => {:file => path_to_video}, :encoder_id => encoder_id},
|
87
|
+
:basic_auth => @auth})
|
88
|
+
end
|
89
|
+
|
90
|
+
private
|
91
|
+
|
92
|
+
def encode_credentials(username, password)
|
93
|
+
{:username => username, :password => password}
|
90
94
|
end
|
91
95
|
|
92
96
|
end
|
93
97
|
|
98
|
+
|
94
99
|
# Let's use it!
|
95
100
|
#
|
96
101
|
irb
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
data/enigmamachine.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enigmamachine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 3
|
10
|
+
version: 0.3.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- dave
|