wordy-ruby 0.1.0
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/.travis.yml +5 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +43 -0
- data/README.markdown +28 -0
- data/Rakefile +43 -0
- data/VERSION +1 -0
- data/lib/wordy/account.rb +15 -0
- data/lib/wordy/cli.rb +52 -0
- data/lib/wordy/job.rb +99 -0
- data/lib/wordy.rb +28 -0
- data/rWordy.gemspec +73 -0
- data/spec/spec_helper.rb +8 -0
- data/spec/wordy/account_spec.rb +25 -0
- data/spec/wordy/job_spec.rb +80 -0
- data/wordy.gemspec +73 -0
- metadata +152 -0
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (3.2.3)
|
5
|
+
i18n (~> 0.6)
|
6
|
+
multi_json (~> 1.0)
|
7
|
+
diff-lcs (1.1.3)
|
8
|
+
git (1.2.5)
|
9
|
+
i18n (0.6.0)
|
10
|
+
jeweler (1.8.3)
|
11
|
+
bundler (~> 1.0)
|
12
|
+
git (>= 1.2.5)
|
13
|
+
rake
|
14
|
+
rdoc
|
15
|
+
json (1.6.6)
|
16
|
+
multi_json (1.2.0)
|
17
|
+
rake (0.9.2.2)
|
18
|
+
rdoc (3.12)
|
19
|
+
json (~> 1.4)
|
20
|
+
rspec (2.9.0)
|
21
|
+
rspec-core (~> 2.9.0)
|
22
|
+
rspec-expectations (~> 2.9.0)
|
23
|
+
rspec-mocks (~> 2.9.0)
|
24
|
+
rspec-core (2.9.0)
|
25
|
+
rspec-expectations (2.9.1)
|
26
|
+
diff-lcs (~> 1.1.3)
|
27
|
+
rspec-mocks (2.9.0)
|
28
|
+
shoulda (3.0.1)
|
29
|
+
shoulda-context (~> 1.0.0)
|
30
|
+
shoulda-matchers (~> 1.0.0)
|
31
|
+
shoulda-context (1.0.0)
|
32
|
+
shoulda-matchers (1.0.0)
|
33
|
+
|
34
|
+
PLATFORMS
|
35
|
+
ruby
|
36
|
+
|
37
|
+
DEPENDENCIES
|
38
|
+
activesupport (>= 3.2.2)
|
39
|
+
bundler (~> 1.1.0)
|
40
|
+
jeweler
|
41
|
+
rake
|
42
|
+
rspec (>= 2.9.0)
|
43
|
+
shoulda (>= 3.0.1)
|
data/README.markdown
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
[](http://travis-ci.org/bastien/wordy)
|
2
|
+
|
3
|
+
Installation
|
4
|
+
------------
|
5
|
+
|
6
|
+
gem install wordy-ruby
|
7
|
+
|
8
|
+
Usage
|
9
|
+
-----
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'rubygems'
|
13
|
+
require 'wordy'
|
14
|
+
|
15
|
+
# if you're using rails, put this in an initializer file
|
16
|
+
Wordy.configure do |c|
|
17
|
+
c.api_key = ENV['WORDY_API_KEY']
|
18
|
+
c.username = ENV['WORDY_USERNAME']
|
19
|
+
end
|
20
|
+
|
21
|
+
if Wordy::Account.balance > 0
|
22
|
+
job = Wordy::Job.create(1, 'Text I want to proofread', 'An optional title')
|
23
|
+
# See Account.languages to see the list of available languages and their ids
|
24
|
+
job.pay!
|
25
|
+
puts "Your text will be ready at: #{job.delivery_date}"
|
26
|
+
end
|
27
|
+
|
28
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
|
14
|
+
Jeweler::Tasks.new do |gem|
|
15
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
16
|
+
gem.name = "wordy-ruby"
|
17
|
+
gem.homepage = "http://github.com/bastien/wordy"
|
18
|
+
gem.license = "MIT"
|
19
|
+
gem.summary = "Wordy API"
|
20
|
+
gem.description = "Ruby library to access the Wordy API"
|
21
|
+
gem.email = "bastien.vaucher@gmail.com"
|
22
|
+
gem.authors = ["Bastien Vaucher - MagmaHQ"]
|
23
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
24
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
25
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
26
|
+
gem.add_development_dependency 'rspec', '>= 2.9.0'
|
27
|
+
gem.add_dependency "activesupport", '>= 3.2.2'
|
28
|
+
end
|
29
|
+
Jeweler::RubygemsDotOrgTasks.new
|
30
|
+
|
31
|
+
|
32
|
+
require 'rspec/core'
|
33
|
+
require 'rspec/core/rake_task'
|
34
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
35
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
36
|
+
end
|
37
|
+
|
38
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
39
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
40
|
+
spec.rcov = true
|
41
|
+
end
|
42
|
+
|
43
|
+
task :default => :spec
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Wordy
|
2
|
+
class Account
|
3
|
+
class << self
|
4
|
+
def balance
|
5
|
+
response = Cli.http_get(Wordy::WORDY_URL+'account/', {})
|
6
|
+
return nil if response.empty?
|
7
|
+
response['balance'].to_s.match(/[^0-9]?([0-9]+\.{0,1}[0-9]+)/)[1].to_f
|
8
|
+
end
|
9
|
+
|
10
|
+
def languages
|
11
|
+
Cli.http_get(Wordy::WORDY_URL+'languages/', {})
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/wordy/cli.rb
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
module Wordy
|
2
|
+
class Cli
|
3
|
+
class << self
|
4
|
+
def check_for_exceptions(json_data)
|
5
|
+
if (!json_data.is_a? Array) && json_data['error'].present?
|
6
|
+
raise WordyException, json_data['verbose']
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def decoded_response_body(response_body)
|
11
|
+
if !response_body.empty?
|
12
|
+
json_data = ActiveSupport::JSON.decode(response_body)
|
13
|
+
check_for_exceptions(json_data)
|
14
|
+
json_data
|
15
|
+
else
|
16
|
+
{}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def http_get(url, params)
|
21
|
+
path = "#{url.path}?".concat(params.collect { |k,v| "#{k}=#{CGI::escape(v.to_s)}" }.reverse.join('&')) unless params.nil?
|
22
|
+
|
23
|
+
http = Net::HTTP.new(url.host, url.port)
|
24
|
+
http.use_ssl = true
|
25
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
26
|
+
|
27
|
+
request = Net::HTTP::Get.new(url.request_uri)
|
28
|
+
request.basic_auth Wordy.username, Wordy.api_key
|
29
|
+
|
30
|
+
response = http.request(request)
|
31
|
+
decoded_response_body(response.body)
|
32
|
+
end
|
33
|
+
|
34
|
+
def http_post(url, params)
|
35
|
+
http = Net::HTTP.new(url.host, url.port)
|
36
|
+
http.use_ssl = true
|
37
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
38
|
+
|
39
|
+
request = Net::HTTP::Post.new(url.request_uri)
|
40
|
+
request.set_form_data(params)
|
41
|
+
request.basic_auth Wordy.username, Wordy.api_key
|
42
|
+
|
43
|
+
response = http.request(request)
|
44
|
+
decoded_response_body(response.body)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class WordyException < StandardError
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
data/lib/wordy/job.rb
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
module Wordy
|
2
|
+
class Job
|
3
|
+
attr_reader :attributes
|
4
|
+
|
5
|
+
def initialize(hash)
|
6
|
+
@attributes = {}
|
7
|
+
set_attributes(hash)
|
8
|
+
end
|
9
|
+
|
10
|
+
def set_attributes(hash)
|
11
|
+
@attributes.update hash
|
12
|
+
hash.each do |key, value|
|
13
|
+
metaclass.send :attr_accessor, key
|
14
|
+
if %w(delivery_date created).include? key
|
15
|
+
value = DateTime.strptime(value.to_s,'%s')
|
16
|
+
elsif key == "cost"
|
17
|
+
value = value.to_s.match(/[^0-9]?([0-9]+\.{0,1}[0-9]+)/)[1].to_f
|
18
|
+
end
|
19
|
+
instance_variable_set("@#{key}", value)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def metaclass
|
24
|
+
class << self
|
25
|
+
self
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class << self
|
30
|
+
|
31
|
+
# Parameters
|
32
|
+
# ----------
|
33
|
+
# language_id
|
34
|
+
# intrusive_editing (known in the front-end as content rewrite) true or false
|
35
|
+
# brief
|
36
|
+
# fileToUpload single file to be edited (not supported by this gem)
|
37
|
+
# content raw text to be edited
|
38
|
+
# json flat dictionary of content to be edited '{"My Title":"My Content"}'
|
39
|
+
#
|
40
|
+
# Can only use one of those parameters: fileToUpload, content, json
|
41
|
+
#
|
42
|
+
# Response
|
43
|
+
# --------
|
44
|
+
#
|
45
|
+
# id ID of the newly created job
|
46
|
+
# url URL fragment of the newly created job
|
47
|
+
#
|
48
|
+
def create(language, content, title=nil, intrusive_editing=false, brief=nil)
|
49
|
+
parameters = {:language_id => language, :intrusive_editing => intrusive_editing, :brief => brief}
|
50
|
+
if !title.nil? && !title.empty?
|
51
|
+
parameters[:json] = "{'#{title}':'#{content}'}"
|
52
|
+
else
|
53
|
+
parameters[:content] = content
|
54
|
+
end
|
55
|
+
parameters = parameters.delete_if{|key, value| value.nil? }
|
56
|
+
response = Cli.http_post(Wordy::WORDY_URL+'job/create/', parameters)
|
57
|
+
return new(response)
|
58
|
+
end
|
59
|
+
|
60
|
+
def all
|
61
|
+
response = Cli.http_get(Wordy::WORDY_URL+"job/", {})
|
62
|
+
response.map do |job_id|
|
63
|
+
new({'id' => job_id})
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def find(id)
|
68
|
+
response = Cli.http_get(Wordy::WORDY_URL+"job/#{id}/", {})
|
69
|
+
return nil if response.empty?
|
70
|
+
new(response.update('id' => id))
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def info
|
75
|
+
response = Cli.http_get(Wordy::WORDY_URL+"job/#{self.id}/", {})
|
76
|
+
set_attributes(response)
|
77
|
+
end
|
78
|
+
|
79
|
+
def conversation
|
80
|
+
Cli.http_get(Wordy::WORDY_URL+"job/#{self.id}/conversation/", {})
|
81
|
+
end
|
82
|
+
|
83
|
+
def update_conversation(message)
|
84
|
+
Cli.http_post(Wordy::WORDY_URL+"job/#{self.id}/conversation/", {'message' => message})
|
85
|
+
end
|
86
|
+
|
87
|
+
def pay!
|
88
|
+
Cli.http_post(Wordy::WORDY_URL+"job/#{self.id}/pay/", {})
|
89
|
+
end
|
90
|
+
|
91
|
+
def confirm!
|
92
|
+
Cli.http_post(Wordy::WORDY_URL+"job/#{self.id}/confirm/", {})
|
93
|
+
end
|
94
|
+
|
95
|
+
def reject!
|
96
|
+
Cli.http_post(Wordy::WORDY_URL+"job/#{self.id}/reject/", {})
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
data/lib/wordy.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require "net/http"
|
2
|
+
# require 'net/http/post/multipart'
|
3
|
+
# require 'digest/md5'
|
4
|
+
require 'uri'
|
5
|
+
require 'cgi'
|
6
|
+
require 'active_support'
|
7
|
+
# require 'active_support/hash_with_indifferent_access'
|
8
|
+
|
9
|
+
module Wordy
|
10
|
+
WORDY_URL = URI.parse('https://staging.wordy.com/api/1.0/')
|
11
|
+
|
12
|
+
class << self
|
13
|
+
attr_accessor :api_key, :username
|
14
|
+
|
15
|
+
# In your initializer:
|
16
|
+
# Wordy.configure do |c|
|
17
|
+
# c.api_key = ENV['WORDY_API_KEY']
|
18
|
+
# c.username = ENV['WORDY_USERNAME']
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
def configure
|
22
|
+
yield self
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
Dir[File.dirname(__FILE__) +"/wordy/*.rb"].each {|file| require file }
|
data/rWordy.gemspec
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "rWordy"
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Bastien Vaucher - MagmaHQ"]
|
12
|
+
s.date = "2012-04-16"
|
13
|
+
s.description = "Ruby library to access the Wordy API"
|
14
|
+
s.email = "bastien.vaucher@gmail.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.markdown"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".travis.yml",
|
20
|
+
"Gemfile",
|
21
|
+
"Gemfile.lock",
|
22
|
+
"README.markdown",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"lib/wordy.rb",
|
26
|
+
"lib/wordy/account.rb",
|
27
|
+
"lib/wordy/cli.rb",
|
28
|
+
"lib/wordy/job.rb",
|
29
|
+
"spec/spec_helper.rb",
|
30
|
+
"spec/wordy/account_spec.rb",
|
31
|
+
"spec/wordy/job_spec.rb",
|
32
|
+
"wordy.gemspec"
|
33
|
+
]
|
34
|
+
s.homepage = "http://github.com/bastien/wordy"
|
35
|
+
s.licenses = ["MIT"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = "1.8.17"
|
38
|
+
s.summary = "Wordy API"
|
39
|
+
|
40
|
+
if s.respond_to? :specification_version then
|
41
|
+
s.specification_version = 3
|
42
|
+
|
43
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
44
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
45
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 3.2.2"])
|
46
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.1.0"])
|
47
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<rspec>, [">= 2.9.0"])
|
49
|
+
s.add_development_dependency(%q<shoulda>, [">= 3.0.1"])
|
50
|
+
s.add_development_dependency(%q<rspec>, [">= 2.9.0"])
|
51
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 3.2.2"])
|
52
|
+
else
|
53
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
54
|
+
s.add_dependency(%q<activesupport>, [">= 3.2.2"])
|
55
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.0"])
|
56
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
57
|
+
s.add_dependency(%q<rspec>, [">= 2.9.0"])
|
58
|
+
s.add_dependency(%q<shoulda>, [">= 3.0.1"])
|
59
|
+
s.add_dependency(%q<rspec>, [">= 2.9.0"])
|
60
|
+
s.add_dependency(%q<activesupport>, [">= 3.2.2"])
|
61
|
+
end
|
62
|
+
else
|
63
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
64
|
+
s.add_dependency(%q<activesupport>, [">= 3.2.2"])
|
65
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.0"])
|
66
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
67
|
+
s.add_dependency(%q<rspec>, [">= 2.9.0"])
|
68
|
+
s.add_dependency(%q<shoulda>, [">= 3.0.1"])
|
69
|
+
s.add_dependency(%q<rspec>, [">= 2.9.0"])
|
70
|
+
s.add_dependency(%q<activesupport>, [">= 3.2.2"])
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Wordy::Account do
|
4
|
+
describe "Checking account balance" do
|
5
|
+
it "should return the amount of money still available" do
|
6
|
+
Wordy::Cli.stub!(:http_get).and_return({"balance"=>"$666"})
|
7
|
+
Wordy::Account.balance.should == 666.0
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should return the amount of money still available with decimals" do
|
11
|
+
Wordy::Cli.stub!(:http_get).and_return({"balance"=>"$666.50"})
|
12
|
+
Wordy::Account.balance.should == 666.50
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should return the amount of money still available even if no currency symbol is present" do
|
16
|
+
Wordy::Cli.stub!(:http_get).and_return({"balance"=>"666.50"})
|
17
|
+
Wordy::Account.balance.should == 666.50
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should return nil if Wordy returns nothing" do
|
21
|
+
Wordy::Cli.stub!(:http_get).and_return({})
|
22
|
+
Wordy::Account.balance.should be_nil
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Wordy::Job do
|
4
|
+
|
5
|
+
let(:wordy_job) do
|
6
|
+
{
|
7
|
+
"id" => 666,
|
8
|
+
"status" => "acp",
|
9
|
+
"source_language_name" => "English (UK)",
|
10
|
+
"source_word_count" => 2,
|
11
|
+
"cost" => "$9.00",
|
12
|
+
"intrusive_editing" => false,
|
13
|
+
"target_url" => "/jobs/17792/target/",
|
14
|
+
"created" => 1334065282,
|
15
|
+
"brief" => "Great editing!",
|
16
|
+
"delivery_date" => 1334065882,
|
17
|
+
"source_url" => "/jobs/17792/source/"
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "Getting the list of all the jobs" do
|
22
|
+
it "should gather a list of job ids" do
|
23
|
+
Wordy::Cli.stub!(:http_get).and_return([33, 666])
|
24
|
+
Wordy::Job.all.map(&:id).should == [33, 666]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "Creating a new job" do
|
29
|
+
it "should create a new job with a title" do
|
30
|
+
Wordy::Cli.stub!(:http_post).and_return(wordy_job)
|
31
|
+
Wordy::Cli.should_receive(:http_post).with(Wordy::WORDY_URL+'job/create/', {
|
32
|
+
:language_id => 'en',
|
33
|
+
:intrusive_editing=>false,
|
34
|
+
:json => "{'My title':'My great content'}"
|
35
|
+
})
|
36
|
+
job = Wordy::Job.create('en', 'My great content', 'My title')
|
37
|
+
job.id.should == 666
|
38
|
+
job.cost.should == 9.0
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should create a new job without a title" do
|
42
|
+
Wordy::Cli.stub!(:http_post).and_return(wordy_job)
|
43
|
+
Wordy::Cli.should_receive(:http_post).with(Wordy::WORDY_URL+'job/create/', {
|
44
|
+
:language_id => 'en',
|
45
|
+
:intrusive_editing=>false,
|
46
|
+
:content => 'My great content'
|
47
|
+
})
|
48
|
+
job = Wordy::Job.create('en', 'My great content')
|
49
|
+
job.id.should == 666
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe "Accessing a specific job" do
|
54
|
+
it "should gather a list of job ids" do
|
55
|
+
Wordy::Cli.stub!(:http_get).and_return(wordy_job)
|
56
|
+
job = Wordy::Job.find(666)
|
57
|
+
job.delivery_date.should == DateTime.parse('2012-04-10T15:51:22+02:00')
|
58
|
+
job.id.should == 666
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe "Fetching info on a job" do
|
63
|
+
it "should update the attributes of a job based on info from Wordy" do
|
64
|
+
@job = Wordy::Job.new({'id' => 666})
|
65
|
+
Wordy::Cli.stub!(:http_get).and_return(wordy_job)
|
66
|
+
@job.info
|
67
|
+
@job.delivery_date.should == DateTime.parse('2012-04-10T15:51:22+02:00')
|
68
|
+
@job.id.should == 666
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "Paying for a job" do
|
73
|
+
end
|
74
|
+
|
75
|
+
describe "Rejecting a job" do
|
76
|
+
end
|
77
|
+
|
78
|
+
describe "Confirming a job" do
|
79
|
+
end
|
80
|
+
end
|
data/wordy.gemspec
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "wordy"
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Bastien Vaucher - MagmaHQ"]
|
12
|
+
s.date = "2012-04-16"
|
13
|
+
s.description = "Ruby library to access the Wordy API"
|
14
|
+
s.email = "bastien.vaucher@gmail.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.markdown"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".travis.yml",
|
20
|
+
"Gemfile",
|
21
|
+
"Gemfile.lock",
|
22
|
+
"README.markdown",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"lib/wordy.rb",
|
26
|
+
"lib/wordy/account.rb",
|
27
|
+
"lib/wordy/cli.rb",
|
28
|
+
"lib/wordy/job.rb",
|
29
|
+
"spec/spec_helper.rb",
|
30
|
+
"spec/wordy/account_spec.rb",
|
31
|
+
"spec/wordy/job_spec.rb",
|
32
|
+
"wordy.gemspec"
|
33
|
+
]
|
34
|
+
s.homepage = "http://github.com/bastien/wordy"
|
35
|
+
s.licenses = ["MIT"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = "1.8.17"
|
38
|
+
s.summary = "Wordy API"
|
39
|
+
|
40
|
+
if s.respond_to? :specification_version then
|
41
|
+
s.specification_version = 3
|
42
|
+
|
43
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
44
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
45
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 3.2.2"])
|
46
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.1.0"])
|
47
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<rspec>, [">= 2.9.0"])
|
49
|
+
s.add_development_dependency(%q<shoulda>, [">= 3.0.1"])
|
50
|
+
s.add_development_dependency(%q<rspec>, [">= 2.9.0"])
|
51
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 3.2.2"])
|
52
|
+
else
|
53
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
54
|
+
s.add_dependency(%q<activesupport>, [">= 3.2.2"])
|
55
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.0"])
|
56
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
57
|
+
s.add_dependency(%q<rspec>, [">= 2.9.0"])
|
58
|
+
s.add_dependency(%q<shoulda>, [">= 3.0.1"])
|
59
|
+
s.add_dependency(%q<rspec>, [">= 2.9.0"])
|
60
|
+
s.add_dependency(%q<activesupport>, [">= 3.2.2"])
|
61
|
+
end
|
62
|
+
else
|
63
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
64
|
+
s.add_dependency(%q<activesupport>, [">= 3.2.2"])
|
65
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.0"])
|
66
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
67
|
+
s.add_dependency(%q<rspec>, [">= 2.9.0"])
|
68
|
+
s.add_dependency(%q<shoulda>, [">= 3.0.1"])
|
69
|
+
s.add_dependency(%q<rspec>, [">= 2.9.0"])
|
70
|
+
s.add_dependency(%q<activesupport>, [">= 3.2.2"])
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
metadata
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wordy-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Bastien Vaucher - MagmaHQ
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-04-16 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: &70245580798660 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70245580798660
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activesupport
|
27
|
+
requirement: &70245580798060 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.2.2
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70245580798060
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: bundler
|
38
|
+
requirement: &70245580797580 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.1.0
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70245580797580
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: jeweler
|
49
|
+
requirement: &70245580796980 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70245580796980
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rspec
|
60
|
+
requirement: &70245580796380 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 2.9.0
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70245580796380
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: shoulda
|
71
|
+
requirement: &70245580795780 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 3.0.1
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70245580795780
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rspec
|
82
|
+
requirement: &70245580795200 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 2.9.0
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70245580795200
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: activesupport
|
93
|
+
requirement: &70245580794720 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 3.2.2
|
99
|
+
type: :runtime
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70245580794720
|
102
|
+
description: Ruby library to access the Wordy API
|
103
|
+
email: bastien.vaucher@gmail.com
|
104
|
+
executables: []
|
105
|
+
extensions: []
|
106
|
+
extra_rdoc_files:
|
107
|
+
- README.markdown
|
108
|
+
files:
|
109
|
+
- .travis.yml
|
110
|
+
- Gemfile
|
111
|
+
- Gemfile.lock
|
112
|
+
- README.markdown
|
113
|
+
- Rakefile
|
114
|
+
- VERSION
|
115
|
+
- lib/wordy.rb
|
116
|
+
- lib/wordy/account.rb
|
117
|
+
- lib/wordy/cli.rb
|
118
|
+
- lib/wordy/job.rb
|
119
|
+
- rWordy.gemspec
|
120
|
+
- spec/spec_helper.rb
|
121
|
+
- spec/wordy/account_spec.rb
|
122
|
+
- spec/wordy/job_spec.rb
|
123
|
+
- wordy.gemspec
|
124
|
+
homepage: http://github.com/bastien/wordy
|
125
|
+
licenses:
|
126
|
+
- MIT
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
none: false
|
133
|
+
requirements:
|
134
|
+
- - ! '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
segments:
|
138
|
+
- 0
|
139
|
+
hash: 2298843696035064710
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
+
none: false
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 1.8.17
|
149
|
+
signing_key:
|
150
|
+
specification_version: 3
|
151
|
+
summary: Wordy API
|
152
|
+
test_files: []
|