turbotlib 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 391f3798df619721914d91b8a156fe291ca73d9f
4
- data.tar.gz: 1e8d98af34360c41d09a36e5edd24e33f7763f5f
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OWJlY2FkNTRiYmEwNmRlNzZiNWE0NzBhMjBkYmQ3ZmNkNjMzMGU2NA==
5
+ data.tar.gz: !binary |-
6
+ OGJkZDRkNGIxMmRmOTk1ZmFkZDhhOTFmMGZhNjRjZTU5MWYxYTZjOA==
5
7
  SHA512:
6
- metadata.gz: a5de4acec5d8e1c178aaeacea4b3db3c453f4c010adbb6d79a97611ad4b5b79171d5880d41f15f66a0855e19c2b1c06dc4764726fc39eb0ba9d420cfd849bcb8
7
- data.tar.gz: ce62a44337089490d479f04a4f051f952fde99abf68389afc696fea516f2e835878e0276568aa451bf5ce23533ee8e521c936aef51e18dc1169bb72e226d08c5
8
+ metadata.gz: !binary |-
9
+ ZDUwYmRlNDYyYWEyYTE0YjhkYjM1Nzk0YzFjZjkyZGM4OTBlNzJlZWJhMjEw
10
+ N2FjM2NhYmYxYzQ1NTM1MDA5NzkzZTVlY2UzN2I4OGNjOTI1YjYxYTQ2Mjcw
11
+ Y2FiN2E3YmI4YTFhZTM0OGQ4ZGRkNTkxM2RiMzI1NjYyNmRlODk=
12
+ data.tar.gz: !binary |-
13
+ ZTI2YzQyN2EwNzM0YTY5ZTBmZDZiMTJhOTMxNWM4MjkwNGJjMmEwMDFjMTBk
14
+ ZDZjZDJkM2ZhOGYyNGU2ZjA3MTA4YjYwOWNkNWFmNTMyM2Y1ZjE4ZmYxYjA5
15
+ ZmQ4OGU5MTQ0YWQ5ZjdiMTk5MmNjNThkNTBlYWM0YmYyY2YxNmI=
@@ -0,0 +1,3 @@
1
+ module TurbotLib
2
+ VERSION = "0.0.2"
3
+ end
data/lib/turbotlib.rb ADDED
@@ -0,0 +1,19 @@
1
+ module Turbotlib
2
+ def self.log(message)
3
+ $stderr.puts message
4
+ end
5
+
6
+ def self.data_dir
7
+ if in_production?
8
+ "/data"
9
+ else
10
+ "data"
11
+ end
12
+ end
13
+
14
+ private
15
+ def self.in_production?
16
+ !!ENV['MORPH_URL']
17
+ end
18
+
19
+ end
@@ -0,0 +1,29 @@
1
+ require 'turbotlib'
2
+
3
+ describe Turbotlib do
4
+ describe "log" do
5
+ it "should print message" do
6
+ expect {
7
+ Turbotlib.log("hi")
8
+ }.to output("hi\n").to_stderr
9
+ end
10
+ end
11
+
12
+ describe "data_dir" do
13
+ context "when developing" do
14
+ it "should return data" do
15
+ expect(Turbotlib.data_dir).to eq("data")
16
+ end
17
+ end
18
+
19
+ context "when running in morph" do
20
+ before do
21
+ allow(ENV).to receive(:[]).with("MORPH_URL").and_return("something")
22
+ end
23
+
24
+ it "should return /data" do
25
+ expect(Turbotlib.data_dir).to eq("/data")
26
+ end
27
+ end
28
+ end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbotlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Turbot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-20 00:00:00.000000000 Z
11
+ date: 2014-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: openc_bot
@@ -29,7 +29,10 @@ email: support@turbot.opencorporates.com
29
29
  executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
- files: []
32
+ files:
33
+ - lib/turbotlib.rb
34
+ - lib/turbotlib/version.rb
35
+ - spec/turbotlib_spec.rb
33
36
  homepage: http://turbot.opencorporates.com/
34
37
  licenses:
35
38
  - MIT
@@ -40,18 +43,19 @@ require_paths:
40
43
  - lib
41
44
  required_ruby_version: !ruby/object:Gem::Requirement
42
45
  requirements:
43
- - - '>='
46
+ - - ! '>='
44
47
  - !ruby/object:Gem::Version
45
48
  version: 1.9.2
46
49
  required_rubygems_version: !ruby/object:Gem::Requirement
47
50
  requirements:
48
- - - '>='
51
+ - - ! '>='
49
52
  - !ruby/object:Gem::Version
50
53
  version: '0'
51
54
  requirements: []
52
55
  rubyforge_project:
53
- rubygems_version: 2.0.14
56
+ rubygems_version: 2.2.2
54
57
  signing_key:
55
58
  specification_version: 4
56
59
  summary: Helpers for writing turbot bots.
57
60
  test_files: []
61
+ has_rdoc: