cartographie 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --color
2
2
  --format progress
3
+ --order rand
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Cartographie
2
2
 
3
3
  [![Build Status](https://secure.travis-ci.org/mattonrails/cartographie.png?branch=master)](http://travis-ci.org/mattonrails/cartographie)
4
- [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/mattonrails/cartographie)
4
+ [![Code Climate](https://codeclimate.com/github/mattonrails/cartographie.png)](https://codeclimate.com/github/mattonrails/cartographie)
5
5
 
6
6
  Cartographie is a wrapper for Google's Static Maps API, but it can support your
7
7
  own custom API, too!
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.add_dependency("addressable")
19
19
  gem.add_development_dependency("rake")
20
- gem.add_development_dependency("rspec", "~>2.11")
20
+ gem.add_development_dependency("rspec", "~>2.13")
21
21
  end
@@ -6,6 +6,10 @@ module Cartographie
6
6
  yield self
7
7
  end
8
8
 
9
+ def reset
10
+ OPTIONS.replace DEFAULTS
11
+ end
12
+
9
13
  def api_endpoint
10
14
  OPTIONS[:api_endpoint]
11
15
  end
@@ -1,3 +1,3 @@
1
1
  module Cartographie
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -4,6 +4,7 @@ require 'cartographie/config'
4
4
 
5
5
  describe Cartographie::Config do
6
6
  subject { Cartographie::Config }
7
+ after { Cartographie::Config.reset }
7
8
 
8
9
  describe "default configs" do
9
10
  its(:api_endpoint) { should eq('http://maps.googleapis.com/maps/api/staticmap') }
@@ -25,10 +26,39 @@ describe Cartographie::Config do
25
26
  end
26
27
  end
27
28
 
29
+
28
30
  its(:width) { should eq(100) }
29
31
  its(:height) { should eq(100) }
30
32
  its(:zoom) { should eq(10) }
31
33
  its(:file_format) { should eq('jpg') }
32
34
  its(:sensor) { should be_true }
33
35
  end
36
+
37
+ describe "resetting to defaults" do
38
+ before do
39
+ Cartographie.configure do |config|
40
+ config.width = 50
41
+ config.height = 50
42
+ config.zoom = 5
43
+ config.file_format = 'gif'
44
+ config.sensor = true
45
+ end
46
+ end
47
+
48
+ it "replaces all custom configuration" do
49
+ expect(Cartographie::Config.width).to eq(50)
50
+ expect(Cartographie::Config.height).to eq(50)
51
+ expect(Cartographie::Config.zoom).to eq(5)
52
+ expect(Cartographie::Config.file_format).to eq('gif')
53
+ expect(Cartographie::Config.sensor).to eq(true)
54
+
55
+ Cartographie::Config.reset
56
+
57
+ expect(Cartographie::Config.width).to eq(300)
58
+ expect(Cartographie::Config.height).to eq(300)
59
+ expect(Cartographie::Config.zoom).to eq(15)
60
+ expect(Cartographie::Config.file_format).to eq('png')
61
+ expect(Cartographie::Config.sensor).to eq(false)
62
+ end
63
+ end
34
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cartographie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-19 00:00:00.000000000 Z
12
+ date: 2013-05-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: '2.11'
53
+ version: '2.13'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '2.11'
61
+ version: '2.13'
62
62
  description: Beautiful map generation
63
63
  email:
64
64
  - mattonrails@shortmail.com
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  segments:
98
98
  - 0
99
- hash: 3633727194628838157
99
+ hash: 2231243369816765640
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  none: false
102
102
  requirements:
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  segments:
107
107
  - 0
108
- hash: 3633727194628838157
108
+ hash: 2231243369816765640
109
109
  requirements: []
110
110
  rubyforge_project:
111
111
  rubygems_version: 1.8.23