dimma 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
File without changes
data/.gitignore CHANGED
@@ -1,23 +1,6 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
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
@@ -0,0 +1,3 @@
1
+ -Ilib
2
+ -fs
3
+ --color
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gemspec
@@ -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/projects/Burgestrand/Dimma).
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 'rake'
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
2
3
 
3
- begin
4
- require 'jeweler'
5
- Jeweler::Tasks.new do |gem|
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 'spec/rake/spectask'
25
- Spec::Rake::SpecTask.new(:spec) do |spec|
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 :spec => :check_dependencies
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
@@ -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 |s|
7
- s.name = %q{dimma}
8
- s.version = "1.0.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Kim Burgestrand"]
12
- s.date = %q{2010-07-31}
13
- s.email = %q{kim@burgestrand.se}
14
- s.extra_rdoc_files = [
15
- "LICENSE",
16
- "README.markdown"
17
- ]
18
- s.files = [
19
- ".document",
20
- ".gitignore",
21
- "LICENSE",
22
- "README.markdown",
23
- "Rakefile",
24
- "VERSION",
25
- "dimma.gemspec",
26
- "lib/dimma.rb",
27
- "spec/dimma_spec.rb",
28
- "spec/spec.opts",
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
 
@@ -1,6 +1,15 @@
1
+ require 'dimma/version'
1
2
  require 'delegate'
2
3
  require 'rest_client'
3
- require 'json'
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 *args
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 Session#initialize)
64
+ # @return (see User#initialize)
56
65
  def user(name)
57
66
  User.new(name, __getobj__)
58
67
  end
@@ -0,0 +1,5 @@
1
+ module Dimma
2
+ # Dimmas’ version.
3
+ # @see http://semver.org/
4
+ VERSION = %w(1 1 0).join(".")
5
+ end
@@ -1,4 +1,8 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
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 == ['Kim']
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
- hash: 21
5
- prerelease: false
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
- prerelease: false
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
- hash: 3
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
- requirement: &id002 !ruby/object:Gem::Requirement
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
- hash: 3
44
- segments:
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
- requirement: &id003 !ruby/object:Gem::Requirement
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
- hash: 3
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
- requirement: &id004 !ruby/object:Gem::Requirement
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
- hash: 13
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
- requirement: &id005 !ruby/object:Gem::Requirement
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
- hash: 3
88
- segments:
89
- - 0
90
- version: "0"
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
91
67
  type: :development
92
- version_requirements: *id005
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
- extra_rdoc_files:
100
- - LICENSE
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
- - --charset=UTF-8
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
- hash: 3
140
- segments:
141
- - 0
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.3.7
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
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.0.1
@@ -1,2 +0,0 @@
1
- --color
2
- -fs
@@ -1,9 +0,0 @@
1
- $:.unshift File.dirname(__FILE__)
2
- $:.unshift File.expand_path('../../lib', __FILE__)
3
- require 'dimma'
4
- require 'spec'
5
- require 'webmock/rspec'
6
-
7
- Spec::Runner.configure do |config|
8
- config.include WebMock
9
- end