billomat-rb 0.0.2 → 0.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 601faa4c399de4bb184f8c46786a425d8dcedb2c
4
+ data.tar.gz: 14af334e4a5757c61052e8aa41553ca8d514dc75
5
+ SHA512:
6
+ metadata.gz: e956cbfe03df3a83a0a7a8de58902f4d6505821f90de6137b21dac058f979dac5c3d14d44ffe9126153488e9bcb50c1693a024c063759ff76e73eabb572ba316
7
+ data.tar.gz: a87e160c1a8210c15b82b5ee53de6ce35e2fd81f0a29de05a015708d41d77420ec907a3d5b5481111f410c709724a595c9cc26fbafc323210e1c82aa6072eaec
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'activesupport', '~> 3.2.17'
4
+ gem 'activeresource', '~> 3.2.17'
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem 'shoulda', '>= 0'
10
+ gem 'rdoc', '~> 3.12'
11
+ gem 'bundler', '~> 1.0'
12
+ gem 'jeweler', '~> 2.0.1'
13
+ gem 'simplecov', '>= 0'
14
+ end
@@ -0,0 +1,83 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activemodel (3.2.17)
5
+ activesupport (= 3.2.17)
6
+ builder (~> 3.0.0)
7
+ activeresource (3.2.17)
8
+ activemodel (= 3.2.17)
9
+ activesupport (= 3.2.17)
10
+ activesupport (3.2.17)
11
+ i18n (~> 0.6, >= 0.6.4)
12
+ multi_json (~> 1.0)
13
+ addressable (2.3.6)
14
+ builder (3.0.4)
15
+ descendants_tracker (0.0.4)
16
+ thread_safe (~> 0.3, >= 0.3.1)
17
+ docile (1.1.3)
18
+ faraday (0.9.0)
19
+ multipart-post (>= 1.2, < 3)
20
+ git (1.2.6)
21
+ github_api (0.11.3)
22
+ addressable (~> 2.3)
23
+ descendants_tracker (~> 0.0.1)
24
+ faraday (~> 0.8, < 0.10)
25
+ hashie (>= 1.2)
26
+ multi_json (>= 1.7.5, < 2.0)
27
+ nokogiri (~> 1.6.0)
28
+ oauth2
29
+ hashie (2.1.1)
30
+ highline (1.6.21)
31
+ i18n (0.6.9)
32
+ jeweler (2.0.1)
33
+ builder
34
+ bundler (>= 1.0)
35
+ git (>= 1.2.5)
36
+ github_api
37
+ highline (>= 1.6.15)
38
+ nokogiri (>= 1.5.10)
39
+ rake
40
+ rdoc
41
+ json (1.8.1)
42
+ jwt (0.1.11)
43
+ multi_json (>= 1.5)
44
+ mini_portile (0.5.3)
45
+ multi_json (1.9.3)
46
+ multi_xml (0.5.5)
47
+ multipart-post (2.0.0)
48
+ nokogiri (1.6.1)
49
+ mini_portile (~> 0.5.0)
50
+ oauth2 (0.9.3)
51
+ faraday (>= 0.8, < 0.10)
52
+ jwt (~> 0.1.8)
53
+ multi_json (~> 1.3)
54
+ multi_xml (~> 0.5)
55
+ rack (~> 1.2)
56
+ rack (1.5.2)
57
+ rake (10.3.1)
58
+ rdoc (3.12.2)
59
+ json (~> 1.4)
60
+ shoulda (3.5.0)
61
+ shoulda-context (~> 1.0, >= 1.0.1)
62
+ shoulda-matchers (>= 1.4.1, < 3.0)
63
+ shoulda-context (1.2.1)
64
+ shoulda-matchers (2.6.1)
65
+ activesupport (>= 3.0.0)
66
+ simplecov (0.8.2)
67
+ docile (~> 1.1.0)
68
+ multi_json
69
+ simplecov-html (~> 0.8.0)
70
+ simplecov-html (0.8.0)
71
+ thread_safe (0.3.3)
72
+
73
+ PLATFORMS
74
+ ruby
75
+
76
+ DEPENDENCIES
77
+ activeresource (~> 3.2.17)
78
+ activesupport (~> 3.2.17)
79
+ bundler (~> 1.0)
80
+ jeweler (~> 2.0.1)
81
+ rdoc (~> 3.12)
82
+ shoulda
83
+ simplecov
@@ -1,20 +1,20 @@
1
- Copyright (c) 2009 Ronald Becher
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2009 - 2014 Ronald Brachetti
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -2,6 +2,11 @@ h1. billomat-rb
2
2
 
3
3
  A neat ruby library for interacting with the "RESTful API":http://www.billomat.com/api/ of "billomat":http://www.billomat.com/.
4
4
 
5
+ h2. Warning
6
+
7
+ This is work in progress (and has been for quite some time).
8
+ Feedback and patches are welcome, though :)
9
+
5
10
  h2. Requirements
6
11
 
7
12
  billomat-rb requires active_resource and active_support in version 2.3.2 or above.
@@ -18,4 +23,4 @@ h2. Note on Patches/Pull Requests
18
23
 
19
24
  h2. Copyright
20
25
 
21
- Copyright (c) 2010 Ronald Becher. See LICENSE for details.
26
+ Copyright (c) 2009 - 2014 Ronald Becher. See LICENSE for details.
data/Rakefile CHANGED
@@ -1,42 +1,48 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts 'Run `bundle install` to install missing gems'
10
+ exit e.status_code
11
+ end
2
12
  require 'rake'
3
13
 
4
- task :default => [:build]
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
+ gem.name = 'billomat-rb'
18
+ gem.homepage = 'http://github.com/rbecher/billomat-rb'
19
+ gem.license = 'MIT'
20
+ gem.summary = 'Ruby library for interacting with the RESTfull billomat api.'
21
+ gem.description = 'A neat ruby library for interacting with the RESTfull API of billomat'
22
+ gem.email = 'rb@ronald-becher.com'
23
+ gem.authors = ['Ronald Brachetti']
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
5
27
 
6
- $gem_name = "billomat-rb"
7
-
8
- #desc "Run specs"
9
- #task :spec do
10
- # sh "spec spec/* --format specdoc --color"
11
- #end
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
12
34
 
13
- begin
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
16
- gem.name = "billomat-rb"
17
- gem.summary = "Ruby library for interacting with the RESTfull billomat api."
18
- gem.description = "A neat ruby library for interacting with the RESTfull API of billomat"
19
- gem.email = "rb@ronald-becher.com"
20
- gem.homepage = "http://github.com/rbecher/billomat-rb"
21
- gem.authors = ["Ronald Becher"]
22
- gem.rubyforge_project = "billomat-rb"
23
- gem.add_dependency(%q<activesupport>, [">= 2.3.2"])
24
- gem.add_dependency(%q<activeresource>, [">= 2.3.2"])
25
- end
26
- Jeweler::RubyforgeTasks.new do |rubyforge|
27
- rubyforge.doc_task = "rdoc"
28
- end
29
- rescue LoadError
30
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
35
+ desc 'Code coverage detail'
36
+ task :simplecov do
37
+ ENV['COVERAGE'] = 'true'
38
+ Rake::Task['test'].execute
31
39
  end
32
40
 
33
- require 'rake/rdoctask'
41
+ task :default => :test
42
+
43
+ require 'rdoc/task'
34
44
  Rake::RDocTask.new do |rdoc|
35
- if File.exist?('VERSION')
36
- version = File.read('VERSION')
37
- else
38
- version = ""
39
- end
45
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
40
46
 
41
47
  rdoc.rdoc_dir = 'rdoc'
42
48
  rdoc.title = "billomat-rb #{version}"
@@ -1,5 +1,5 @@
1
- ---
2
- :build:
3
- :patch: 2
4
- :major: 0
5
- :minor: 0
1
+ ---
2
+ :major: 0
3
+ :minor: 0
4
+ :patch: 3
5
+ :build:
@@ -1,58 +1,85 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{billomat-rb}
8
- s.version = "0.0.2"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Ronald Becher"]
12
- s.date = %q{2010-04-01}
13
- s.description = %q{A neat ruby library for interacting with the RESTfull API of billomat}
14
- s.email = %q{rb@ronald-becher.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.textile"
18
- ]
19
- s.files = [
20
- ".gitignore",
21
- "CHANGES.textile",
22
- "LICENSE",
23
- "README.textile",
24
- "Rakefile",
25
- "TODO.textile",
26
- "VERSION.yml",
27
- "billomat-rb.gemspec",
28
- "lib/billomat-rb.rb",
29
- "lib/billomat/clients.rb",
30
- "lib/billomat/myself.rb",
31
- "lib/billomat/settings.rb",
32
- "lib/billomat/unit.rb",
33
- "lib/billomat/users.rb"
34
- ]
35
- s.homepage = %q{http://github.com/rbecher/billomat-rb}
36
- s.rdoc_options = ["--charset=UTF-8"]
37
- s.require_paths = ["lib"]
38
- s.rubyforge_project = %q{billomat-rb}
39
- s.rubygems_version = %q{1.3.6}
40
- s.summary = %q{Ruby library for interacting with the RESTfull billomat api.}
41
-
42
- if s.respond_to? :specification_version then
43
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
44
- s.specification_version = 3
45
-
46
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
47
- s.add_runtime_dependency(%q<activesupport>, [">= 2.3.2"])
48
- s.add_runtime_dependency(%q<activeresource>, [">= 2.3.2"])
49
- else
50
- s.add_dependency(%q<activesupport>, [">= 2.3.2"])
51
- s.add_dependency(%q<activeresource>, [">= 2.3.2"])
52
- end
53
- else
54
- s.add_dependency(%q<activesupport>, [">= 2.3.2"])
55
- s.add_dependency(%q<activeresource>, [">= 2.3.2"])
56
- end
57
- end
58
-
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
+ # stub: billomat-rb 0.0.3 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "billomat-rb"
9
+ s.version = "0.0.3"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Ronald Brachetti"]
14
+ s.date = "2014-05-03"
15
+ s.description = "A neat ruby library for interacting with the RESTfull API of billomat"
16
+ s.email = "rb@ronald-becher.com"
17
+ s.extra_rdoc_files = [
18
+ "LICENSE.txt",
19
+ "README.textile"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ "CHANGES.textile",
24
+ "Gemfile",
25
+ "Gemfile.lock",
26
+ "LICENSE.txt",
27
+ "README.textile",
28
+ "Rakefile",
29
+ "TODO.textile",
30
+ "VERSION.yml",
31
+ "billomat-rb.gemspec",
32
+ "billomat-rb.iml",
33
+ "examples/example.rb",
34
+ "lib/billomat-rb.rb",
35
+ "lib/billomat/articles.rb",
36
+ "lib/billomat/clients.rb",
37
+ "lib/billomat/confirmation.rb",
38
+ "lib/billomat/invoice.rb",
39
+ "lib/billomat/myself.rb",
40
+ "lib/billomat/offer.rb",
41
+ "lib/billomat/reminder.rb",
42
+ "lib/billomat/role.rb",
43
+ "lib/billomat/settings.rb",
44
+ "lib/billomat/template.rb",
45
+ "lib/billomat/unit.rb",
46
+ "lib/billomat/users.rb",
47
+ "test/helper.rb",
48
+ "test/test_billomat-rb.rb"
49
+ ]
50
+ s.homepage = "http://github.com/rbecher/billomat-rb"
51
+ s.licenses = ["MIT"]
52
+ s.rubygems_version = "2.2.2"
53
+ s.summary = "Ruby library for interacting with the RESTfull billomat api."
54
+
55
+ if s.respond_to? :specification_version then
56
+ s.specification_version = 4
57
+
58
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
59
+ s.add_runtime_dependency(%q<activesupport>, ["~> 3.2.17"])
60
+ s.add_runtime_dependency(%q<activeresource>, ["~> 3.2.17"])
61
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
62
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
63
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
64
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
65
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
66
+ else
67
+ s.add_dependency(%q<activesupport>, ["~> 3.2.17"])
68
+ s.add_dependency(%q<activeresource>, ["~> 3.2.17"])
69
+ s.add_dependency(%q<shoulda>, [">= 0"])
70
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
71
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
72
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
73
+ s.add_dependency(%q<simplecov>, [">= 0"])
74
+ end
75
+ else
76
+ s.add_dependency(%q<activesupport>, ["~> 3.2.17"])
77
+ s.add_dependency(%q<activeresource>, ["~> 3.2.17"])
78
+ s.add_dependency(%q<shoulda>, [">= 0"])
79
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
80
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
81
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
82
+ s.add_dependency(%q<simplecov>, [">= 0"])
83
+ end
84
+ end
85
+
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ <orderEntry type="library" scope="PROVIDED" name="activemodel (v3.2.17, RVM: ruby-2.1.1) [gem]" level="application" />
9
+ <orderEntry type="library" scope="PROVIDED" name="activeresource (v3.2.17, RVM: ruby-2.1.1) [gem]" level="application" />
10
+ <orderEntry type="library" scope="PROVIDED" name="activesupport (v3.2.17, RVM: ruby-2.1.1) [gem]" level="application" />
11
+ <orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.6, RVM: ruby-2.1.1) [gem]" level="application" />
12
+ <orderEntry type="library" scope="PROVIDED" name="builder (v3.0.4, RVM: ruby-2.1.1) [gem]" level="application" />
13
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.6.1, RVM: ruby-2.1.1) [gem]" level="application" />
14
+ <orderEntry type="library" scope="PROVIDED" name="descendants_tracker (v0.0.4, RVM: ruby-2.1.1) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="docile (v1.1.3, RVM: ruby-2.1.1) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="faraday (v0.9.0, RVM: ruby-2.1.1) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="git (v1.2.6, RVM: ruby-2.1.1) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="github_api (v0.11.3, RVM: ruby-2.1.1) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="hashie (v2.1.1, RVM: ruby-2.1.1) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="highline (v1.6.21, RVM: ruby-2.1.1) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="i18n (v0.6.9, RVM: ruby-2.1.1) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="jeweler (v2.0.1, RVM: ruby-2.1.1) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="jwt (v0.1.11, RVM: ruby-2.1.1) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="mini_portile (v0.5.3, RVM: ruby-2.1.1) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="multi_json (v1.9.3, RVM: ruby-2.1.1) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="multi_xml (v0.5.5, RVM: ruby-2.1.1) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="multipart-post (v2.0.0, RVM: ruby-2.1.1) [gem]" level="application" />
28
+ <orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.6.1, RVM: ruby-2.1.1) [gem]" level="application" />
29
+ <orderEntry type="library" scope="PROVIDED" name="oauth2 (v0.9.3, RVM: ruby-2.1.1) [gem]" level="application" />
30
+ <orderEntry type="library" scope="PROVIDED" name="rack (v1.5.2, RVM: ruby-2.1.1) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="rake (v10.3.1, RVM: ruby-2.1.1) [gem]" level="application" />
32
+ <orderEntry type="library" scope="PROVIDED" name="rdoc (v3.12.2, RVM: ruby-2.1.1) [gem]" level="application" />
33
+ <orderEntry type="library" scope="PROVIDED" name="shoulda (v3.5.0, RVM: ruby-2.1.1) [gem]" level="application" />
34
+ <orderEntry type="library" scope="PROVIDED" name="shoulda-context (v1.2.1, RVM: ruby-2.1.1) [gem]" level="application" />
35
+ <orderEntry type="library" scope="PROVIDED" name="shoulda-matchers (v2.6.1, RVM: ruby-2.1.1) [gem]" level="application" />
36
+ <orderEntry type="library" scope="PROVIDED" name="simplecov (v0.8.2, RVM: ruby-2.1.1) [gem]" level="application" />
37
+ <orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.8.0, RVM: ruby-2.1.1) [gem]" level="application" />
38
+ <orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.3, RVM: ruby-2.1.1) [gem]" level="application" />
39
+ </component>
40
+ </module>
41
+
File without changes
@@ -1,11 +1,10 @@
1
1
  require 'rubygems'
2
- gem 'activeresource', '=2.3.5'
3
- gem 'activesupport', '=2.3.5'
2
+ gem 'activeresource', '=3.2.17'
3
+ gem 'activesupport', '=3.2.17'
4
4
  require 'active_support'
5
5
  require 'active_resource'
6
6
 
7
7
  # A neat ruby library for interacting with the RESTfull API of billomat
8
-
9
8
  module Billomat
10
9
 
11
10
  class << self
@@ -38,6 +37,7 @@ module Billomat
38
37
  def key=(value)
39
38
  resources.each do |klass|
40
39
  klass.headers['X-BillomatApiKey'] = value
40
+ klass.headers['Accept'] = 'application/json' # hack :-(
41
41
  end
42
42
  @key = value
43
43
  @email = nil
@@ -53,7 +53,14 @@ module Billomat
53
53
  # Same as validate
54
54
  # but raises http-error when connection is invalid
55
55
  def validate!
56
- !!Billomat::Myself.find
56
+ if Billomat.account.nil?
57
+ raise 'No Account set, use Billomat.account='
58
+ end
59
+ if !Billomat.key.nil? || ( !Billomat.email.nil? && !Billomat.password.nil? )
60
+ !!Billomat::Myself.find
61
+ else
62
+ raise 'No authentication info set, set either Billomat.key XOR use Billomat.authenticate(email, password)'
63
+ end
57
64
  end
58
65
 
59
66
  def resources
@@ -62,10 +69,12 @@ module Billomat
62
69
  end
63
70
 
64
71
  self.host_format = '%s://%s%s%s' # protocol :// domain_format port path
65
- self.domain_format = '%s.billomat.net'
72
+ #self.domain_format = '%s.billomat.net'
73
+ self.domain_format = 'localhost'
66
74
  self.api_path = '/api'
67
75
  self.protocol = 'http'
68
- self.port = '80'
76
+ #self.port = '80'
77
+ self.port = '8081'
69
78
 
70
79
  class MethodNotAvailable < StandardError; end
71
80
 
@@ -95,7 +104,9 @@ module Billomat
95
104
 
96
105
  class Base < ActiveResource::Base
97
106
  class << self
98
- ActiveSupport.dasherize_xml = false
107
+
108
+ # TODO somehow use json http://www.billomat.com/de/api/grundlagen
109
+
99
110
  def inherited(base)
100
111
  unless base == Billomat::SingletonBase
101
112
  Billomat.resources << base
@@ -198,29 +209,12 @@ module Billomat
198
209
  end
199
210
  end
200
211
 
201
- module ActiveSupport #:nodoc:
202
- module CoreExtensions #:nodoc:
203
- module Hash #:nodoc:
204
- module Conversions
205
- def self.included(klass)
206
- klass.extend(ClassMethods)
207
- end
208
-
209
- module ClassMethods
210
-
211
- private
212
-
213
- # Dirty monkey patching indeed
214
- def typecast_xml_value_with_array_fix(value)
215
- value.delete('total')
216
- value.delete('type')
217
- value.delete('per_page')
218
- value.delete('page')
219
- typecast_xml_value_without_array_fix(value)
220
- end
221
-
222
- alias_method_chain :typecast_xml_value, :array_fix
223
- end
212
+ module ActiveResource
213
+ module Formats
214
+ module JsonFormat
215
+ def decode(json)
216
+ formatted = Formats.remove_root(ActiveSupport::JSON.decode(json)).except('@page', '@per_page', '@total')
217
+ Formats.remove_root formatted
224
218
  end
225
219
  end
226
220
  end
@@ -230,6 +224,12 @@ end
230
224
  #Dir[File.join(File.dirname(__FILE__), "billomat/*.rb")].each { |f| require f }
231
225
 
232
226
  require File.dirname(__FILE__) + '/billomat/settings'
227
+ require File.dirname(__FILE__) + '/billomat/articles'
228
+ require File.dirname(__FILE__) + '/billomat/invoice'
229
+ require File.dirname(__FILE__) + '/billomat/offer'
230
+ require File.dirname(__FILE__) + '/billomat/reminder'
231
+ require File.dirname(__FILE__) + '/billomat/template'
232
+ require File.dirname(__FILE__) + '/billomat/role'
233
233
  require File.dirname(__FILE__) + '/billomat/users'
234
234
  require File.dirname(__FILE__) + '/billomat/myself'
235
235
  require File.dirname(__FILE__) + '/billomat/clients'
@@ -0,0 +1,2 @@
1
+ class Billomat::Article < Billomat::Base
2
+ end
@@ -1,5 +1,2 @@
1
- class Billomat::Clients < Billomat::SingletonBase
2
- end
3
-
4
1
  class Billomat::Client < Billomat::Base
5
2
  end
@@ -0,0 +1,2 @@
1
+ class Billomat::Confirmation < Billomat::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ class Billomat::Invoice < Billomat::Base
2
+ end
@@ -2,14 +2,6 @@ class Billomat::Myself < Billomat::ReadOnlySingletonBase
2
2
 
3
3
  # non standard path
4
4
  def self.element_name
5
- "users/myself"
6
- end
7
-
8
- # get the billomat user for the logged in person
9
- def user
10
- Billomat::Users.all.each do |user|
11
- return user if user.id==self.id
12
- end
13
- raise StandardError
5
+ 'users/myself'
14
6
  end
15
7
  end
@@ -0,0 +1,2 @@
1
+ class Billomat::Offer < Billomat::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ class Billomat::Reminder < Billomat::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ class Billomat::Role < Billomat::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ class Billomat::Template < Billomat::Base
2
+ end
@@ -1,5 +1,2 @@
1
- class Billomat::Units < Billomat::SingletonBase
2
- end
3
-
4
1
  class Billomat::Unit < Billomat::Base
5
2
  end
@@ -0,0 +1,34 @@
1
+ require 'simplecov'
2
+
3
+ module SimpleCov::Configuration
4
+ def clean_filters
5
+ @filters = []
6
+ end
7
+ end
8
+
9
+ SimpleCov.configure do
10
+ clean_filters
11
+ load_adapter 'test_frameworks'
12
+ end
13
+
14
+ ENV["COVERAGE"] && SimpleCov.start do
15
+ add_filter "/.rvm/"
16
+ end
17
+ require 'rubygems'
18
+ require 'bundler'
19
+ begin
20
+ Bundler.setup(:default, :development)
21
+ rescue Bundler::BundlerError => e
22
+ $stderr.puts e.message
23
+ $stderr.puts "Run `bundle install` to install missing gems"
24
+ exit e.status_code
25
+ end
26
+ require 'test/unit'
27
+ require 'shoulda'
28
+
29
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
30
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
31
+ require 'billomat-rb'
32
+
33
+ class Test::Unit::TestCase
34
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestBillomatRb < Test::Unit::TestCase
4
+ should 'probably rename this file and start testing for real' do
5
+ flunk 'hey buddy, you should probably rename this file and start testing for real'
6
+ end
7
+ end
metadata CHANGED
@@ -1,103 +1,170 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: billomat-rb
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 2
9
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
10
5
  platform: ruby
11
- authors:
12
- - Ronald Becher
6
+ authors:
7
+ - Ronald Brachetti
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2010-04-01 00:00:00 +02:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2014-05-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: activesupport
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 2
29
- - 3
30
- - 2
31
- version: 2.3.2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.17
32
20
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.17
27
+ - !ruby/object:Gem::Dependency
35
28
  name: activeresource
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 3.2.17
34
+ type: :runtime
36
35
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- requirements:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 3.2.17
41
+ - !ruby/object:Gem::Dependency
42
+ name: shoulda
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
39
45
  - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 2
43
- - 3
44
- - 2
45
- version: 2.3.2
46
- type: :runtime
47
- version_requirements: *id002
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rdoc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.12'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.12'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: jeweler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 2.0.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 2.0.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: simplecov
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
48
111
  description: A neat ruby library for interacting with the RESTfull API of billomat
49
112
  email: rb@ronald-becher.com
50
113
  executables: []
51
-
52
114
  extensions: []
53
-
54
- extra_rdoc_files:
55
- - LICENSE
115
+ extra_rdoc_files:
116
+ - LICENSE.txt
56
117
  - README.textile
57
- files:
58
- - .gitignore
118
+ files:
119
+ - ".document"
59
120
  - CHANGES.textile
60
- - LICENSE
121
+ - Gemfile
122
+ - Gemfile.lock
123
+ - LICENSE.txt
61
124
  - README.textile
62
125
  - Rakefile
63
126
  - TODO.textile
64
127
  - VERSION.yml
65
128
  - billomat-rb.gemspec
129
+ - billomat-rb.iml
130
+ - examples/example.rb
66
131
  - lib/billomat-rb.rb
132
+ - lib/billomat/articles.rb
67
133
  - lib/billomat/clients.rb
134
+ - lib/billomat/confirmation.rb
135
+ - lib/billomat/invoice.rb
68
136
  - lib/billomat/myself.rb
137
+ - lib/billomat/offer.rb
138
+ - lib/billomat/reminder.rb
139
+ - lib/billomat/role.rb
69
140
  - lib/billomat/settings.rb
141
+ - lib/billomat/template.rb
70
142
  - lib/billomat/unit.rb
71
143
  - lib/billomat/users.rb
72
- has_rdoc: true
144
+ - test/helper.rb
145
+ - test/test_billomat-rb.rb
73
146
  homepage: http://github.com/rbecher/billomat-rb
74
- licenses: []
75
-
147
+ licenses:
148
+ - MIT
149
+ metadata: {}
76
150
  post_install_message:
77
- rdoc_options:
78
- - --charset=UTF-8
79
- require_paths:
151
+ rdoc_options: []
152
+ require_paths:
80
153
  - lib
81
- required_ruby_version: !ruby/object:Gem::Requirement
82
- requirements:
154
+ required_ruby_version: !ruby/object:Gem::Requirement
155
+ requirements:
83
156
  - - ">="
84
- - !ruby/object:Gem::Version
85
- segments:
86
- - 0
87
- version: "0"
88
- required_rubygems_version: !ruby/object:Gem::Requirement
89
- requirements:
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ required_rubygems_version: !ruby/object:Gem::Requirement
160
+ requirements:
90
161
  - - ">="
91
- - !ruby/object:Gem::Version
92
- segments:
93
- - 0
94
- version: "0"
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
95
164
  requirements: []
96
-
97
- rubyforge_project: billomat-rb
98
- rubygems_version: 1.3.6
165
+ rubyforge_project:
166
+ rubygems_version: 2.2.2
99
167
  signing_key:
100
- specification_version: 3
168
+ specification_version: 4
101
169
  summary: Ruby library for interacting with the RESTfull billomat api.
102
170
  test_files: []
103
-
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- .idea
2
- *.gem
3
- pkg
4
- doc
5
- .DS_Store
6
- debug.rb
7
- *~
8
- *.sw?
9
- coverage
10
- pkg
11
- .rdoc