printreleaf 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,8 @@
1
+ module PrintReleaf
2
+ module Transforms
3
+ Integer = lambda { |v| v.to_i }
4
+ Float = lambda { |v| v.to_f }
5
+ Date = lambda { |v| v.nil? ? nil : DateTime.parse(v) }
6
+ end
7
+ end
8
+
@@ -0,0 +1,20 @@
1
+ module PrintReleaf
2
+ class User < Resource
3
+ path "/users"
4
+
5
+ action :find
6
+ action :list
7
+ action :delete
8
+
9
+ property :id
10
+ property :account_id
11
+ property :name
12
+ property :email
13
+ property :created_at, transform_with: Transforms::Date
14
+
15
+ def account
16
+ @account ||= Account.find(account_id)
17
+ end
18
+ end
19
+ end
20
+
@@ -0,0 +1,10 @@
1
+ module PrintReleaf
2
+ module Util
3
+ extend self
4
+
5
+ def join_uri(*args)
6
+ Array(args).compact.join("/").gsub(/\/{2,}/, "/").chomp("/")
7
+ end
8
+ end
9
+ end
10
+
@@ -0,0 +1,3 @@
1
+ module PrintReleaf
2
+ VERSION = "1.0.1"
3
+ end
@@ -0,0 +1,17 @@
1
+ module PrintReleaf
2
+ class VolumePeriod < Resource
3
+ path "/volume"
4
+
5
+ action :list
6
+
7
+ property :account_id
8
+ property :date, transform_with: Transforms::Date
9
+ property :pages, transform_with: Transforms::Integer
10
+ property :trees, transform_with: Transforms::Float
11
+
12
+ def account
13
+ @account ||= Account.find(account_id)
14
+ end
15
+ end
16
+ end
17
+
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'printreleaf/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "printreleaf"
8
+ spec.version = PrintReleaf::VERSION
9
+ spec.authors = ["Casey O'Hara"]
10
+ spec.email = ["cohara@printreleaf.com"]
11
+ spec.summary = "Ruby toolkit for the PrintReleaf API"
12
+ spec.description = "Ruby toolkit for the PrintReleaf API"
13
+ spec.homepage = "https://github.com/printreleaf/printreleaf-ruby"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency "hashie", "~> 3.4", ">= 3.4.6"
21
+ spec.add_dependency "rest-client", "~> 2.0"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.11"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec", "~> 3.0"
26
+ end
27
+
metadata ADDED
@@ -0,0 +1,151 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: printreleaf
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Casey O'Hara
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hashie
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.4'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.4.6
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3.4'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.4.6
33
+ - !ruby/object:Gem::Dependency
34
+ name: rest-client
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '2.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.11'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.11'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '10.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '10.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rspec
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '3.0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '3.0'
89
+ description: Ruby toolkit for the PrintReleaf API
90
+ email:
91
+ - cohara@printreleaf.com
92
+ executables:
93
+ - printreleaf-console
94
+ extensions: []
95
+ extra_rdoc_files: []
96
+ files:
97
+ - ".gitignore"
98
+ - ".rspec"
99
+ - ".travis.yml"
100
+ - Gemfile
101
+ - LICENSE.txt
102
+ - README.md
103
+ - Rakefile
104
+ - bin/printreleaf-console
105
+ - lib/printreleaf.rb
106
+ - lib/printreleaf/account.rb
107
+ - lib/printreleaf/actions.rb
108
+ - lib/printreleaf/api.rb
109
+ - lib/printreleaf/certificate.rb
110
+ - lib/printreleaf/deposit.rb
111
+ - lib/printreleaf/error.rb
112
+ - lib/printreleaf/forestry/project.rb
113
+ - lib/printreleaf/invitation.rb
114
+ - lib/printreleaf/paper/type.rb
115
+ - lib/printreleaf/relation.rb
116
+ - lib/printreleaf/resource.rb
117
+ - lib/printreleaf/server.rb
118
+ - lib/printreleaf/source.rb
119
+ - lib/printreleaf/transaction.rb
120
+ - lib/printreleaf/transaction_item.rb
121
+ - lib/printreleaf/transforms.rb
122
+ - lib/printreleaf/user.rb
123
+ - lib/printreleaf/util.rb
124
+ - lib/printreleaf/version.rb
125
+ - lib/printreleaf/volume_period.rb
126
+ - printreleaf.gemspec
127
+ homepage: https://github.com/printreleaf/printreleaf-ruby
128
+ licenses:
129
+ - MIT
130
+ metadata: {}
131
+ post_install_message:
132
+ rdoc_options: []
133
+ require_paths:
134
+ - lib
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ requirements: []
146
+ rubyforge_project:
147
+ rubygems_version: 2.4.5
148
+ signing_key:
149
+ specification_version: 4
150
+ summary: Ruby toolkit for the PrintReleaf API
151
+ test_files: []