writeit-rails 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -71
- data/lib/{models → writeit-rails}/message.rb +2 -2
- data/lib/{models → writeit-rails}/writeitinstance.rb +4 -0
- data/lib/writeit-rails.rb +3 -0
- data/spec/message_model_spec.rb +1 -2
- data/spec/writeitinstance_spec.rb +2 -1
- data/start-local-writeit.bash +1 -0
- data/writeit-rails.gemspec +4 -3
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c8b15d3555c505a31e8f49978768e6e97d0ef67
|
4
|
+
data.tar.gz: d53d53b11d143cdb9dca12f01da29bc94da837fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edfe9627ced8e8afa630205a1de2f662aa8c5a727aa2f8b83a028ce6643010833b1e3ab6dfc3abfe738e1dab5f55335e95219285ec7f05816f2de517d4ea92bd
|
7
|
+
data.tar.gz: b92ff79bfa9e65b663b694c96c3446cfa012a2b2f3b65095e0e45efd2c442ed7641ddebb7bc018250c0538a0972f3c448584f8d05b4ecae7bf4d6c577399ec9c
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,33 +1,6 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
actionmailer (4.0.0)
|
5
|
-
actionpack (= 4.0.0)
|
6
|
-
mail (~> 2.5.3)
|
7
|
-
actionpack (4.0.0)
|
8
|
-
activesupport (= 4.0.0)
|
9
|
-
builder (~> 3.1.0)
|
10
|
-
erubis (~> 2.7.0)
|
11
|
-
rack (~> 1.5.2)
|
12
|
-
rack-test (~> 0.6.2)
|
13
|
-
activemodel (4.0.0)
|
14
|
-
activesupport (= 4.0.0)
|
15
|
-
builder (~> 3.1.0)
|
16
|
-
activerecord (4.0.0)
|
17
|
-
activemodel (= 4.0.0)
|
18
|
-
activerecord-deprecated_finders (~> 1.0.2)
|
19
|
-
activesupport (= 4.0.0)
|
20
|
-
arel (~> 4.0.0)
|
21
|
-
activerecord-deprecated_finders (1.0.3)
|
22
|
-
activesupport (4.0.0)
|
23
|
-
i18n (~> 0.6, >= 0.6.4)
|
24
|
-
minitest (~> 4.2)
|
25
|
-
multi_json (~> 1.3)
|
26
|
-
thread_safe (~> 0.1)
|
27
|
-
tzinfo (~> 0.3.37)
|
28
|
-
arel (4.0.1)
|
29
|
-
atomic (1.1.14)
|
30
|
-
builder (3.1.4)
|
31
4
|
coveralls (0.7.0)
|
32
5
|
multi_json (~> 1.3)
|
33
6
|
rest-client
|
@@ -35,35 +8,9 @@ GEM
|
|
35
8
|
term-ansicolor
|
36
9
|
thor
|
37
10
|
diff-lcs (1.2.5)
|
38
|
-
erubis (2.7.0)
|
39
|
-
hike (1.2.3)
|
40
|
-
i18n (0.6.9)
|
41
|
-
mail (2.5.4)
|
42
|
-
mime-types (~> 1.16)
|
43
|
-
treetop (~> 1.4.8)
|
44
|
-
mime-types (1.25)
|
45
|
-
minitest (4.7.5)
|
46
11
|
multi_json (1.8.2)
|
47
|
-
polyglot (0.3.3)
|
48
|
-
rack (1.5.2)
|
49
|
-
rack-test (0.6.2)
|
50
|
-
rack (>= 1.0)
|
51
|
-
rails (4.0.0)
|
52
|
-
actionmailer (= 4.0.0)
|
53
|
-
actionpack (= 4.0.0)
|
54
|
-
activerecord (= 4.0.0)
|
55
|
-
activesupport (= 4.0.0)
|
56
|
-
bundler (>= 1.3.0, < 2.0)
|
57
|
-
railties (= 4.0.0)
|
58
|
-
sprockets-rails (~> 2.0.0)
|
59
|
-
railties (4.0.0)
|
60
|
-
actionpack (= 4.0.0)
|
61
|
-
activesupport (= 4.0.0)
|
62
|
-
rake (>= 0.8.7)
|
63
|
-
thor (>= 0.18.1, < 2.0)
|
64
12
|
rake (10.1.1)
|
65
|
-
rest-client (
|
66
|
-
mime-types (>= 1.16)
|
13
|
+
rest-client (0.9.2)
|
67
14
|
rspec (2.14.1)
|
68
15
|
rspec-core (~> 2.14.0)
|
69
16
|
rspec-expectations (~> 2.14.0)
|
@@ -76,33 +23,17 @@ GEM
|
|
76
23
|
multi_json (~> 1.0)
|
77
24
|
simplecov-html (~> 0.7.1)
|
78
25
|
simplecov-html (0.7.1)
|
79
|
-
sprockets (2.10.0)
|
80
|
-
hike (~> 1.2)
|
81
|
-
multi_json (~> 1.0)
|
82
|
-
rack (~> 1.0)
|
83
|
-
tilt (~> 1.1, != 1.3.0)
|
84
|
-
sprockets-rails (2.0.0)
|
85
|
-
actionpack (>= 3.0)
|
86
|
-
activesupport (>= 3.0)
|
87
|
-
sprockets (~> 2.8)
|
88
26
|
term-ansicolor (1.2.2)
|
89
27
|
tins (~> 0.8)
|
90
28
|
thor (0.18.1)
|
91
|
-
thread_safe (0.1.3)
|
92
|
-
atomic
|
93
|
-
tilt (1.4.1)
|
94
29
|
tins (0.12.0)
|
95
|
-
treetop (1.4.15)
|
96
|
-
polyglot
|
97
|
-
polyglot (>= 0.3.1)
|
98
|
-
tzinfo (0.3.38)
|
99
30
|
|
100
31
|
PLATFORMS
|
101
32
|
ruby
|
102
33
|
|
103
34
|
DEPENDENCIES
|
104
35
|
coveralls
|
105
|
-
rails (= 4.0.0)
|
106
36
|
rake
|
37
|
+
rest-client (~> 0)
|
107
38
|
rspec
|
108
39
|
rspec-core
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'active_record'
|
2
1
|
require 'json'
|
2
|
+
require 'rest-client'
|
3
3
|
|
4
4
|
class Message
|
5
5
|
attr_accessor :subject
|
@@ -19,7 +19,7 @@ class Message
|
|
19
19
|
end
|
20
20
|
raise ArgumentError, 'No recipients, please add some first' unless not wrong_recipients
|
21
21
|
|
22
|
-
validates_author_name = self.author_name.
|
22
|
+
validates_author_name = self.author_name.nil?
|
23
23
|
raise ArgumentError, 'No author, set it first' unless not validates_author_name
|
24
24
|
|
25
25
|
validates_instance = self.writeitinstance.nil?
|
@@ -3,8 +3,12 @@ class WriteItInstance
|
|
3
3
|
attr_accessor :base_url
|
4
4
|
attr_accessor :username
|
5
5
|
attr_accessor :api_key
|
6
|
+
attr_accessor :per_page
|
6
7
|
attr_reader :errors
|
7
8
|
|
9
|
+
def per_page
|
10
|
+
@per_page || 20
|
11
|
+
end
|
8
12
|
|
9
13
|
def validate
|
10
14
|
authorization = 'ApiKey %{username}:%{api_key}' % {
|
data/lib/writeit-rails.rb
CHANGED
data/spec/message_model_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require "
|
1
|
+
require "writeit-rails"
|
2
2
|
require "spec_helper"
|
3
3
|
|
4
4
|
describe WriteItInstance do
|
@@ -13,6 +13,7 @@ describe WriteItInstance do
|
|
13
13
|
writeitinstance.url.should eql '/instances/1/'
|
14
14
|
writeitinstance.username.should eql 'username'
|
15
15
|
writeitinstance.api_key.should eql 'api_key'
|
16
|
+
writeitinstance.per_page.should eql 20
|
16
17
|
end
|
17
18
|
end
|
18
19
|
context "Validation" do
|
data/start-local-writeit.bash
CHANGED
@@ -34,6 +34,7 @@ if [ ! -e done.txt ]; then
|
|
34
34
|
virtualenv $VIRTUALENV
|
35
35
|
source $VIRTUALENV/bin/activate
|
36
36
|
pip install -r requirements.txt
|
37
|
+
pip install -r requirements_testing.txt
|
37
38
|
python manage.py syncdb --noinput
|
38
39
|
python manage.py migrate --noinput
|
39
40
|
python manage.py loaddata ../writeit_example_data.yaml
|
data/writeit-rails.gemspec
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'writeit-rails'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.2'
|
4
4
|
s.date = '2013-12-22'
|
5
5
|
s.summary = "This Gem provides a basic api client for Write-it"
|
6
6
|
s.description = "A simple hello world gem"
|
7
|
-
s.authors = ["
|
7
|
+
s.authors = ["Ciudadano Inteligente"]
|
8
8
|
s.email = 'lab@ciudadanointeligente.org'
|
9
9
|
s.files = `git ls-files`.split("\n")
|
10
10
|
s.homepage = 'http://rubygems.org/gems/writeit-rails'
|
11
11
|
s.license = 'Apache License, Version 2.0'
|
12
|
-
|
12
|
+
s.add_runtime_dependency 'rest-client', '~> 0'
|
13
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: writeit-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Ciudadano Inteligente
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2013-12-22 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
description: A simple hello world gem
|
14
28
|
email: lab@ciudadanointeligente.org
|
15
29
|
executables: []
|
@@ -23,9 +37,9 @@ files:
|
|
23
37
|
- Gemfile.lock
|
24
38
|
- LICENSE
|
25
39
|
- README.md
|
26
|
-
- lib/models/message.rb
|
27
|
-
- lib/models/writeitinstance.rb
|
28
40
|
- lib/writeit-rails.rb
|
41
|
+
- lib/writeit-rails/message.rb
|
42
|
+
- lib/writeit-rails/writeitinstance.rb
|
29
43
|
- rakefile
|
30
44
|
- spec/message_model_spec.rb
|
31
45
|
- spec/spec_helper.rb
|