fare 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c0019fbf8a276f7c14c283ce4464352e0f7615d
4
- data.tar.gz: a7aa3871867ab7a7baead1c33541a23273996dd8
3
+ metadata.gz: 496714fa2c9327da27c286ba35864237dce08deb
4
+ data.tar.gz: e5e12ae873bbc93ae5fadf9fd9ee090f83132cc6
5
5
  SHA512:
6
- metadata.gz: 593d28b21e3ea505860e1c8b712a88c8ef464879fb332a943f0c7d4d7c4d65e163da8aab7f57780829b1ea5d977e55089fd498550b50919d994c771a3d28f7cf
7
- data.tar.gz: 38e798e47e8b446fc0eb3386e9ddc768022186d261b8e48ebbaf32ebc99f540fabf0a47b81d9635f9f3ebddb32b2b445fcbb5f2e7252f83cc975e46b7b51c813
6
+ metadata.gz: c8cfd6df7003675d527b3740f4382c501cb0a4847fd72829e83530e2720814444787dc7a487e9fe12a785be5eddf4f98d91178c03821e8dad2432f77db323cbd
7
+ data.tar.gz: c428fa722d7a2233433fbfb00a6110c5ec1bbd3bd399840d1474d305f0e214ea9e606d23594e01ef1d048eb8583689c17a405e5676992b68912bf64dcd55f4da
@@ -69,10 +69,18 @@ module Fare
69
69
  File.expand_path("config/fare.rb", Dir.pwd)
70
70
  end
71
71
 
72
+ def self.environment=(value)
73
+ @environment = value.to_s
74
+ end
75
+
76
+ def self.environment
77
+ @environment || default_environment
78
+ end
79
+
72
80
  def self.default_environment
73
81
  env = ENV["RACK_ENV"] || ENV["RAILS_ENV"]
74
82
  if env.nil? && defined?(::Rails)
75
- env = Rails.env
83
+ env = Rails.env.to_s
76
84
  end
77
85
  env
78
86
  end
@@ -75,7 +75,7 @@ module Fare
75
75
  end
76
76
 
77
77
  def find_environment
78
- Fare.default_environment || raise(NoEnvironmentFoundError, "No environment specified!")
78
+ Fare.environment || raise(NoEnvironmentFoundError, "No environment specified!")
79
79
  end
80
80
 
81
81
  end
@@ -5,7 +5,7 @@ module Fare
5
5
 
6
6
  def initialize(options)
7
7
  @filename = options.fetch(:filename) { Fare.default_config_file }
8
- @environment = options.fetch(:environment) { Fare.default_environment }
8
+ @environment = options.fetch(:environment) { Fare.environment }
9
9
  verify_file!
10
10
  end
11
11
 
@@ -15,7 +15,9 @@ module Fare
15
15
  def queue
16
16
  sqs.queues.named(queue_name)
17
17
  rescue AWS::SQS::Errors::NonExistentQueue
18
- sqs.queues.create(queue_name)
18
+ sqs.queues.create(queue_name).tap { |queue|
19
+ queue.wait_time_seconds = 20
20
+ }
19
21
  end
20
22
 
21
23
  def queue_name
@@ -36,7 +36,7 @@ module Fare
36
36
  def start
37
37
  fare_options = {
38
38
  filename: Fare.default_config_file,
39
- environment: (Fare.default_environment || "development"),
39
+ environment: (Fare.environment || "development"),
40
40
  }
41
41
  daemon_options = {
42
42
  concurrency: 4,
@@ -147,7 +147,7 @@ module Fare
147
147
  def restart
148
148
  fare_options = {
149
149
  filename: Fare.default_config_file,
150
- environment: (Fare.default_environment || "development"),
150
+ environment: (Fare.environment || "development"),
151
151
  }
152
152
  daemon_options = {
153
153
  concurrency: 4,
@@ -10,7 +10,7 @@ module Fare
10
10
  def call
11
11
  options = {
12
12
  filename: Fare.default_config_file,
13
- environment: (Fare.default_environment || "development"),
13
+ environment: (Fare.environment || "development"),
14
14
  force: false,
15
15
  }
16
16
  parser = OptionParser.new do |o|
@@ -1,3 +1,3 @@
1
1
  module Fare
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - iain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-12 00:00:00.000000000 Z
11
+ date: 2014-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk