shortly 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Bagwan Pankaj
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.
data/README.textile ADDED
@@ -0,0 +1,41 @@
1
+ h1. Shortly
2
+
3
+ A Ruby wrapper for various url shortener services
4
+
5
+ h2. Getting Started
6
+
7
+ create a dependency in your Gemfile
8
+
9
+ @gem 'shortly'@
10
+
11
+ then run
12
+
13
+ @bundle install@
14
+
15
+ and shortly will be up and running.
16
+
17
+ h2. Uses
18
+
19
+ Coming Shortly(or see the code)
20
+
21
+ h2. More Info
22
+
23
+ For detailed info visit my blog "http://BagwanPankaj.com":http://bagwanpankaj.com
24
+
25
+ For more info write me at bagwanpankaj[at]gmail.com or me[at]bagwanpankaj.com
26
+
27
+ Copyright (c) 2010 Bagwan Pankaj: http://bagwanpankaj.com, released under the MIT license
28
+
29
+ h2. Contributing to shortly
30
+
31
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
32
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
33
+ * Fork the project
34
+ * Start a feature/bugfix branch
35
+ * Commit and push until you are happy with your contribution
36
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
37
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
38
+
39
+ h2. Copyright
40
+
41
+ Copyright (c) 2010 [Bagwan Pankaj]. See LICENSE.txt for further details.
data/lib/shortly.rb ADDED
@@ -0,0 +1,10 @@
1
+ require 'uri'
2
+ require 'ostruct'
3
+ require 'httparty'
4
+ require 'shortly'
5
+ require 'shortly/helper'
6
+ require 'shortly/errors'
7
+ require 'shortly/client'
8
+ require 'shortly/clients/bitly'
9
+ require 'shortly/clients/googl'
10
+ require 'shortly/clients/isgd'
@@ -0,0 +1,51 @@
1
+ # Copyright (c) 2011 Bagwan Pankaj
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.
21
+
22
+ module Shortly
23
+
24
+ class Client
25
+
26
+ include HTTParty
27
+ include Shortly::Errors
28
+ include Shortly::Helper
29
+
30
+ base_uri ''
31
+
32
+ def self.shorten(url, options ={})
33
+ raise MethodNotAvailableError.new("Sorry. This method is not available for given service.")
34
+ end
35
+
36
+ def self.expand(url, options ={})
37
+ raise MethodNotAvailableError.new("Sorry. This method is not available for given service.")
38
+ end
39
+
40
+ def self.validate(options = {})
41
+ raise MethodNotAvailableError.new("Sorry. This method is not available for given service.")
42
+ end
43
+
44
+ protected
45
+
46
+ def self.valid_uri?(url)
47
+ !!(url =~ URI::regexp)
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,62 @@
1
+ # Copyright (c) 2011 Bagwan Pankaj
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.
21
+
22
+ module Shortly
23
+
24
+ module Clients
25
+
26
+ class Bitly < Client
27
+
28
+ class << self
29
+ #apiKey = "<your apiKey>"
30
+ #login = "<your login>"
31
+ attr_accessor :login, :apiKey
32
+ end
33
+
34
+ base_uri 'api.bit.ly'
35
+
36
+ #shorts provided url by making call to bitly api with given options.
37
+ def self.shorten(url, options = {})
38
+ raise InvalidURIError.new("provided URI is invalid.") unless valid_uri?(url)
39
+ options = {:login => self.login, :apiKey => self.apiKey, :longUrl => url, :format => "json"}.merge(options)
40
+ response = get("/v3/shorten", {:query => options})
41
+ OpenStruct.new(response["data"])
42
+ end
43
+
44
+ #expands provided url by making call to bitly api with given options.
45
+ def self.expand(short_url, options ={})
46
+ raise InvalidURIError.new("provided URI is invalid.") unless valid_uri?(short_url)
47
+ options = {:login => self.login, :apiKey => self.apiKey, :shortUrl => short_url, :format => "json"}.merge(options)
48
+ response = get("/v3/expand", {:query => options})
49
+ OpenStruct.new(response["data"]["expand"].first)
50
+ end
51
+
52
+ #validates given login(as x_login) and apiKey (as x_api_key)
53
+ #options = {:x_login => xlogin, :x_api_key => x_api_key, :apiKey => apiKey, :login => login, :format => "json"}
54
+ def self.validate(options = {})
55
+ response = get("/v3/validate", {:query => options})
56
+ OpenStruct.new(response["data"])
57
+ end
58
+
59
+ end
60
+
61
+ end
62
+ end
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2011 Bagwan Pankaj
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.
21
+
22
+ module Shortly
23
+
24
+ module Clients
25
+
26
+ class Googl < Client
27
+
28
+ base_uri 'goo.gl'
29
+
30
+ #shorts provided url by making call to goo.gl api with given options.
31
+ def self.shorten(url, options = {})
32
+ raise InvalidURIError.new("provided URI is invalid.") unless valid_uri?(url)
33
+ response = post("/api/shorten", {:body => {:url => url}})
34
+ OpenStruct.new(response)
35
+ end
36
+
37
+ end
38
+
39
+ end
40
+
41
+ end
@@ -0,0 +1,40 @@
1
+ # Copyright (c) 2011 Bagwan Pankaj
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.
21
+
22
+ module Shortly
23
+
24
+ module Clients
25
+
26
+ class Isgd < Client
27
+
28
+ base_uri 'is.gd'
29
+
30
+ #shorts provided url by making call to is.gd api with given options.
31
+ def self.shorten(url, options = {})
32
+ raise InvalidURIError.new("provided URI is invalid.") unless valid_uri?(url)
33
+ options = {:format => "json", :url => url}.merge(options)
34
+ response = get("/create.php", {:query => options})
35
+ OpenStruct.new(response)
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,37 @@
1
+ # Copyright (c) 2011 Bagwan Pankaj
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.
21
+
22
+ module Shortly
23
+
24
+ module Clients
25
+
26
+ class RubyUrl < Client
27
+
28
+ base_uri 'rubyurl.com'
29
+
30
+ def self.shorten(url)
31
+ post('/api/links.json', :query => { :link => { :website_url => url } })
32
+ end
33
+ end
34
+
35
+ end
36
+
37
+ end
@@ -0,0 +1,40 @@
1
+ # Copyright (c) 2011 Bagwan Pankaj
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.
21
+
22
+ module Shortly
23
+
24
+ module Errors
25
+
26
+ class ShortlyError < StandardError
27
+
28
+ def initialize(msg)
29
+ super("ShortlyError - #{msg}")
30
+ end
31
+
32
+ end
33
+
34
+ class ShortlyArgumentError < ArgumentError; end
35
+ class InvalidURIError < ShortlyError; end
36
+ class NotAuthorizedError < ShortlyArgumentError; end
37
+ class MethodNotAvailableError < ShortlyError; end
38
+ end
39
+
40
+ end
@@ -0,0 +1,36 @@
1
+ # Copyright (c) 2011 Bagwan Pankaj
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.
21
+
22
+ module Shortly
23
+
24
+ module Helper
25
+
26
+ class Hash
27
+
28
+ def authenticable?
29
+ [:login, :apiKey].all?{|k| self.key?(k)} && !self.values.any?(&:empty?)
30
+ end
31
+
32
+ end
33
+
34
+ end
35
+
36
+ end
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Shortly" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'shortly'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+
12
+ end
metadata ADDED
@@ -0,0 +1,155 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shortly
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
+ platform: ruby
12
+ authors:
13
+ - Bagwan Pankaj
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-14 00:00:00 +05:30
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ type: :runtime
23
+ prerelease: false
24
+ name: httparty
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: 3
31
+ segments:
32
+ - 0
33
+ version: "0"
34
+ requirement: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ type: :development
37
+ prerelease: false
38
+ name: rspec
39
+ version_requirements: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ hash: 11
45
+ segments:
46
+ - 2
47
+ - 1
48
+ - 0
49
+ version: 2.1.0
50
+ requirement: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ type: :development
53
+ prerelease: false
54
+ name: bundler
55
+ version_requirements: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ~>
59
+ - !ruby/object:Gem::Version
60
+ hash: 23
61
+ segments:
62
+ - 1
63
+ - 0
64
+ - 0
65
+ version: 1.0.0
66
+ requirement: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ type: :development
69
+ prerelease: false
70
+ name: jeweler
71
+ version_requirements: &id004 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ hash: 1
77
+ segments:
78
+ - 1
79
+ - 5
80
+ - 1
81
+ version: 1.5.1
82
+ requirement: *id004
83
+ - !ruby/object:Gem::Dependency
84
+ type: :development
85
+ prerelease: false
86
+ name: rcov
87
+ version_requirements: &id005 !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 3
93
+ segments:
94
+ - 0
95
+ version: "0"
96
+ requirement: *id005
97
+ description: Ruby Wrapper for different Url Shortner Services Ruby Wrapper
98
+ email: bagwanpankaj@gmail.com
99
+ executables: []
100
+
101
+ extensions: []
102
+
103
+ extra_rdoc_files:
104
+ - LICENSE.txt
105
+ - README.textile
106
+ files:
107
+ - lib/shortly.rb
108
+ - lib/shortly/client.rb
109
+ - lib/shortly/clients/bitly.rb
110
+ - lib/shortly/clients/googl.rb
111
+ - lib/shortly/clients/isgd.rb
112
+ - lib/shortly/clients/rubyurl.rb
113
+ - lib/shortly/errors.rb
114
+ - lib/shortly/helper.rb
115
+ - LICENSE.txt
116
+ - README.textile
117
+ - spec/shortly_spec.rb
118
+ - spec/spec_helper.rb
119
+ has_rdoc: true
120
+ homepage: http://github.com/bagwanpankaj/shortly
121
+ licenses:
122
+ - MIT
123
+ post_install_message:
124
+ rdoc_options: []
125
+
126
+ require_paths:
127
+ - lib
128
+ required_ruby_version: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ hash: 3
134
+ segments:
135
+ - 0
136
+ version: "0"
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ hash: 3
143
+ segments:
144
+ - 0
145
+ version: "0"
146
+ requirements: []
147
+
148
+ rubyforge_project:
149
+ rubygems_version: 1.3.7
150
+ signing_key:
151
+ specification_version: 3
152
+ summary: Url Shortner Services Ruby Wrapper
153
+ test_files:
154
+ - spec/shortly_spec.rb
155
+ - spec/spec_helper.rb