dimma 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/.gitignore +6 -23
- data/.rspec +3 -0
- data/Gemfile +2 -0
- data/README.markdown +1 -1
- data/Rakefile +9 -43
- data/dimma.gemspec +24 -64
- data/lib/dimma.rb +12 -3
- data/lib/dimma/version.rb +5 -0
- data/spec/dimma_spec.rb +12 -2
- metadata +70 -107
- data/.document +0 -5
- data/VERSION +0 -1
- data/spec/spec.opts +0 -2
- data/spec/spec_helper.rb +0 -9
data/.gemtest
ADDED
File without changes
|
data/.gitignore
CHANGED
@@ -1,23 +1,6 @@
|
|
1
|
-
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
## EMACS
|
9
|
-
*~
|
10
|
-
\#*
|
11
|
-
.\#*
|
12
|
-
|
13
|
-
## VIM
|
14
|
-
*.swp
|
15
|
-
|
16
|
-
## PROJECT::GENERAL
|
17
|
-
coverage
|
18
|
-
rdoc
|
19
|
-
pkg
|
20
|
-
|
21
|
-
## PROJECT::SPECIFIC
|
22
|
-
.yardoc
|
23
|
-
doc
|
1
|
+
*.gem
|
2
|
+
.bundle
|
3
|
+
Gemfile.lock
|
4
|
+
pkg/*
|
5
|
+
doc/
|
6
|
+
.yardoc
|
data/.rspec
ADDED
data/Gemfile
ADDED
data/README.markdown
CHANGED
@@ -22,7 +22,7 @@ Excellent question! This is how:
|
|
22
22
|
candy = beacon.user "godisnappen88"
|
23
23
|
candy.message 'A/S/L?' if candy.online?
|
24
24
|
|
25
|
-
Really? Yeah, really! For more advanced usage I suggest you [read the documentation](http://rdoc.info/
|
25
|
+
Really? Yeah, really! For more advanced usage I suggest you [read the documentation](http://rdoc.info/github/Burgestrand/Dimma/master/frames).
|
26
26
|
|
27
27
|
Yeah, yeah… and installing it?
|
28
28
|
------------------------------
|
data/Rakefile
CHANGED
@@ -1,47 +1,13 @@
|
|
1
|
-
require '
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
gem.name = "dimma"
|
7
|
-
gem.summary = "A Ruby library for the Beacon REST API"
|
8
|
-
gem.email = "kim@burgestrand.se"
|
9
|
-
gem.homepage = "http://github.com/Burgestrand/Dimma"
|
10
|
-
gem.authors = ["Kim Burgestrand"]
|
11
|
-
gem.license = "X11 License"
|
12
|
-
gem.add_dependency "rest-client"
|
13
|
-
gem.add_dependency "json"
|
14
|
-
gem.add_development_dependency "webmock"
|
15
|
-
gem.add_development_dependency "rspec", ">= 1.2.9"
|
16
|
-
gem.add_development_dependency "yard", ">= 0"
|
17
|
-
gem.required_ruby_version = '>= 1.8.7'
|
18
|
-
end
|
19
|
-
Jeweler::GemcutterTasks.new
|
20
|
-
rescue LoadError
|
21
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
RSpec::Core::RakeTask.new do |spec|
|
6
|
+
spec.skip_bundler = true
|
22
7
|
end
|
23
8
|
|
24
|
-
require '
|
25
|
-
|
26
|
-
spec.libs << 'lib' << 'spec'
|
27
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
28
|
-
end
|
29
|
-
|
30
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
31
|
-
spec.libs << 'lib' << 'spec'
|
32
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
33
|
-
spec.rcov = true
|
34
|
-
end
|
9
|
+
require 'yard'
|
10
|
+
YARD::Rake::YardocTask.new
|
35
11
|
|
36
|
-
task :
|
37
|
-
|
38
|
-
task :default => :spec
|
39
|
-
|
40
|
-
begin
|
41
|
-
require 'yard'
|
42
|
-
YARD::Rake::YardocTask.new
|
43
|
-
rescue LoadError
|
44
|
-
task :yardoc do
|
45
|
-
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
|
46
|
-
end
|
47
|
-
end
|
12
|
+
task :test => :spec
|
13
|
+
task :default => :spec
|
data/dimma.gemspec
CHANGED
@@ -1,68 +1,28 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
require './lib/dimma/version'
|
5
3
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
"
|
16
|
-
|
17
|
-
]
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
"spec/spec_helper.rb"
|
30
|
-
]
|
31
|
-
s.homepage = %q{http://github.com/Burgestrand/Dimma}
|
32
|
-
s.licenses = ["X11 License"]
|
33
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
34
|
-
s.require_paths = ["lib"]
|
35
|
-
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
|
36
|
-
s.rubygems_version = %q{1.3.7}
|
37
|
-
s.summary = %q{A Ruby library for the Beacon REST API}
|
38
|
-
s.test_files = [
|
39
|
-
"spec/dimma_spec.rb",
|
40
|
-
"spec/spec_helper.rb"
|
41
|
-
]
|
42
|
-
|
43
|
-
if s.respond_to? :specification_version then
|
44
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
45
|
-
s.specification_version = 3
|
46
|
-
|
47
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
|
-
s.add_runtime_dependency(%q<rest-client>, [">= 0"])
|
49
|
-
s.add_runtime_dependency(%q<json>, [">= 0"])
|
50
|
-
s.add_development_dependency(%q<webmock>, [">= 0"])
|
51
|
-
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
52
|
-
s.add_development_dependency(%q<yard>, [">= 0"])
|
53
|
-
else
|
54
|
-
s.add_dependency(%q<rest-client>, [">= 0"])
|
55
|
-
s.add_dependency(%q<json>, [">= 0"])
|
56
|
-
s.add_dependency(%q<webmock>, [">= 0"])
|
57
|
-
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
58
|
-
s.add_dependency(%q<yard>, [">= 0"])
|
59
|
-
end
|
60
|
-
else
|
61
|
-
s.add_dependency(%q<rest-client>, [">= 0"])
|
62
|
-
s.add_dependency(%q<json>, [">= 0"])
|
63
|
-
s.add_dependency(%q<webmock>, [">= 0"])
|
64
|
-
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
65
|
-
s.add_dependency(%q<yard>, [">= 0"])
|
66
|
-
end
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = 'dimma'
|
6
|
+
gem.summary = 'A Ruby library for the Beacon REST API'
|
7
|
+
gem.homepage = 'http://github.com/Burgestrand/Dimma'
|
8
|
+
gem.authors = ['Kim Burgestrand']
|
9
|
+
gem.email = 'kim@burgestrand.se'
|
10
|
+
gem.license = 'X11 License'
|
11
|
+
|
12
|
+
gem.files = `git ls-files`.split("\n")
|
13
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
gem.executables = []
|
15
|
+
gem.require_paths = ['lib']
|
16
|
+
|
17
|
+
gem.version = Dimma::VERSION
|
18
|
+
gem.platform = Gem::Platform::RUBY
|
19
|
+
gem.required_ruby_version = '>= 1.8.7'
|
20
|
+
|
21
|
+
gem.requirements << 'JSON::parse'
|
22
|
+
gem.add_dependency 'rest-client'
|
23
|
+
gem.add_development_dependency 'bundler', '~> 1.0.0'
|
24
|
+
gem.add_development_dependency 'webmock'
|
25
|
+
gem.add_development_dependency 'rspec', '~> 2.0'
|
26
|
+
gem.add_development_dependency 'yard'
|
67
27
|
end
|
68
28
|
|
data/lib/dimma.rb
CHANGED
@@ -1,6 +1,15 @@
|
|
1
|
+
require 'dimma/version'
|
1
2
|
require 'delegate'
|
2
3
|
require 'rest_client'
|
3
|
-
|
4
|
+
|
5
|
+
unless defined?(JSON.parse)
|
6
|
+
begin
|
7
|
+
require 'json'
|
8
|
+
rescue LoadError
|
9
|
+
warn "Dimma requires a json library supplying JSON::parse to be available"
|
10
|
+
raise
|
11
|
+
end
|
12
|
+
end
|
4
13
|
|
5
14
|
# See http://beaconpush.com/guide for specification details.
|
6
15
|
#
|
@@ -12,7 +21,7 @@ module Dimma
|
|
12
21
|
# @return (see Session#initialize)
|
13
22
|
# @see Session#initialize
|
14
23
|
def Dimma.new(*args)
|
15
|
-
Session.new
|
24
|
+
Session.new(*args)
|
16
25
|
end
|
17
26
|
|
18
27
|
# Missing method calls are delegated to the underlying RestClient::Resource
|
@@ -52,7 +61,7 @@ module Dimma
|
|
52
61
|
# Retrieve a user by name, bound to this Session.
|
53
62
|
#
|
54
63
|
# @param [#to_s] name
|
55
|
-
# @return (see
|
64
|
+
# @return (see User#initialize)
|
56
65
|
def user(name)
|
57
66
|
User.new(name, __getobj__)
|
58
67
|
end
|
data/spec/dimma_spec.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'dimma'
|
2
|
+
require 'rspec'
|
3
|
+
require 'webmock/rspec'
|
4
|
+
|
5
|
+
RSpec.configure { |c| c.include WebMock::API }
|
2
6
|
|
3
7
|
describe Dimma do
|
4
8
|
before do
|
@@ -21,6 +25,12 @@ describe Dimma do
|
|
21
25
|
stub_request(:delete, @user.url).to_return(:headers => {:code => 204})
|
22
26
|
end
|
23
27
|
|
28
|
+
describe "VERSION" do
|
29
|
+
it "should be defined" do
|
30
|
+
Dimma::VERSION.should be
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
24
34
|
it "can retrieve a total usercount" do
|
25
35
|
@obj.users
|
26
36
|
WebMock.should have_requested(:get, @obj['users'].url)
|
@@ -65,7 +75,7 @@ describe Dimma do
|
|
65
75
|
|
66
76
|
it "should have a list of users" do
|
67
77
|
channel = @obj.channel
|
68
|
-
channel.users.map(&:name).should
|
78
|
+
channel.users.map(&:name).should eq ['Kim']
|
69
79
|
WebMock.should have_requested(:get, channel.url)
|
70
80
|
end
|
71
81
|
end
|
metadata
CHANGED
@@ -1,152 +1,115 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: dimma
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 1
|
10
|
-
version: 1.0.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Kim Burgestrand
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2010-07-31 00:00:00 +02:00
|
12
|
+
date: 2011-04-18 00:00:00.000000000 +02:00
|
19
13
|
default_executable:
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
22
16
|
name: rest-client
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &2156682140 !ruby/object:Gem::Requirement
|
25
18
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
33
23
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: json
|
37
24
|
prerelease: false
|
38
|
-
|
25
|
+
version_requirements: *2156682140
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: bundler
|
28
|
+
requirement: &2156681500 !ruby/object:Gem::Requirement
|
39
29
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
|
45
|
-
- 0
|
46
|
-
version: "0"
|
47
|
-
type: :runtime
|
48
|
-
version_requirements: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: webmock
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.0
|
34
|
+
type: :development
|
51
35
|
prerelease: false
|
52
|
-
|
36
|
+
version_requirements: *2156681500
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: webmock
|
39
|
+
requirement: &2156681020 !ruby/object:Gem::Requirement
|
53
40
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
|
58
|
-
segments:
|
59
|
-
- 0
|
60
|
-
version: "0"
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
61
45
|
type: :development
|
62
|
-
version_requirements: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: rspec
|
65
46
|
prerelease: false
|
66
|
-
|
47
|
+
version_requirements: *2156681020
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rspec
|
50
|
+
requirement: &2156680460 !ruby/object:Gem::Requirement
|
67
51
|
none: false
|
68
|
-
requirements:
|
69
|
-
- -
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
|
72
|
-
segments:
|
73
|
-
- 1
|
74
|
-
- 2
|
75
|
-
- 9
|
76
|
-
version: 1.2.9
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '2.0'
|
77
56
|
type: :development
|
78
|
-
version_requirements: *id004
|
79
|
-
- !ruby/object:Gem::Dependency
|
80
|
-
name: yard
|
81
57
|
prerelease: false
|
82
|
-
|
58
|
+
version_requirements: *2156680460
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: yard
|
61
|
+
requirement: &2156679920 !ruby/object:Gem::Requirement
|
83
62
|
none: false
|
84
|
-
requirements:
|
85
|
-
- -
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
88
|
-
segments:
|
89
|
-
- 0
|
90
|
-
version: "0"
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
91
67
|
type: :development
|
92
|
-
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *2156679920
|
93
70
|
description:
|
94
71
|
email: kim@burgestrand.se
|
95
72
|
executables: []
|
96
|
-
|
97
73
|
extensions: []
|
98
|
-
|
99
|
-
|
100
|
-
-
|
101
|
-
- README.markdown
|
102
|
-
files:
|
103
|
-
- .document
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- .gemtest
|
104
77
|
- .gitignore
|
78
|
+
- .rspec
|
79
|
+
- Gemfile
|
105
80
|
- LICENSE
|
106
81
|
- README.markdown
|
107
82
|
- Rakefile
|
108
|
-
- VERSION
|
109
83
|
- dimma.gemspec
|
110
84
|
- lib/dimma.rb
|
85
|
+
- lib/dimma/version.rb
|
111
86
|
- spec/dimma_spec.rb
|
112
|
-
- spec/spec.opts
|
113
|
-
- spec/spec_helper.rb
|
114
87
|
has_rdoc: true
|
115
88
|
homepage: http://github.com/Burgestrand/Dimma
|
116
|
-
licenses:
|
89
|
+
licenses:
|
117
90
|
- X11 License
|
118
91
|
post_install_message:
|
119
|
-
rdoc_options:
|
120
|
-
|
121
|
-
require_paths:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
122
94
|
- lib
|
123
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
124
96
|
none: false
|
125
|
-
requirements:
|
126
|
-
- -
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
hash: 57
|
129
|
-
segments:
|
130
|
-
- 1
|
131
|
-
- 8
|
132
|
-
- 7
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
133
100
|
version: 1.8.7
|
134
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
102
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
version: "0"
|
143
|
-
requirements: []
|
144
|
-
|
103
|
+
requirements:
|
104
|
+
- - ! '>='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
requirements:
|
108
|
+
- JSON::parse
|
145
109
|
rubyforge_project:
|
146
|
-
rubygems_version: 1.
|
110
|
+
rubygems_version: 1.6.2
|
147
111
|
signing_key:
|
148
112
|
specification_version: 3
|
149
113
|
summary: A Ruby library for the Beacon REST API
|
150
|
-
test_files:
|
114
|
+
test_files:
|
151
115
|
- spec/dimma_spec.rb
|
152
|
-
- spec/spec_helper.rb
|
data/.document
DELETED
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.0.1
|
data/spec/spec.opts
DELETED