fastball 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 705aaa59d0ae67092c18485e8c5a218d1658db10
4
- data.tar.gz: 96d7d30bd753638c8ee846b0e7b18e39ae170057
3
+ metadata.gz: fd8af3009bb223137705487f6484cd31b161e330
4
+ data.tar.gz: 199da7aae7218bb70af11db334cf4b86feb4cb56
5
5
  SHA512:
6
- metadata.gz: 2c91b291b3d3bf04676192761bf830b6030ac9e80cdd331b3e4156b62937d752889a71706fcfae0b6d6fe7c51ab9da23f96e75dcd12065535af8efcdc4d4f607
7
- data.tar.gz: b8715b22588e5749d38d89ad153336bd31ffe30b612a1d3a0006d5e3ed890a31328f6919f48440cd70bd770bf9c2f9b5073e1611f3ec2510c31efa75143f1e5e
6
+ metadata.gz: a48a3c4532bb5176cd3c7aafe802a2a4956c109c71849d0825898148a8846b6fef0c4efcb3af3e021d060244cccabbcda6c687ce682b4e4e1b32c39eb61950db
7
+ data.tar.gz: bb7e9925e4869c0167a8dd05a033fdad55de24f61a1196341937cd1565e2988674b4ddb7aa75c9b1f977a4a79b2524c7e262307f65461699d5281fec8bb0f314
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/jbgo/fastball.svg?branch=master)](https://travis-ci.org/jbgo/fastball)
2
+
1
3
  # Fastball
2
4
 
3
5
  The safest, fastest way to build and deploy dynamic applications.
@@ -35,8 +37,8 @@ rake fastball:config # generate environment specific configuration files
35
37
 
36
38
  ## Documentation
37
39
 
38
- See {Fastball::Config} for documentation and examples of using
39
- Fastball to generate config files.
40
+ See [Fastball::Config](http://www.rubydoc.info/github/jbgo/fastball/master/Fastball/Config)
41
+ for documentation and examples of using Fastball to generate config files.
40
42
 
41
43
  ## Roadmap
42
44
 
@@ -54,7 +56,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
54
56
 
55
57
  ## Contributing
56
58
 
57
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/fastball.
59
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jbgo/fastball.
58
60
 
59
61
 
60
62
  ## License
@@ -1,11 +1,19 @@
1
1
  require 'erb'
2
2
  require 'forwardable'
3
+ require 'json'
3
4
  require 'yaml'
4
5
 
5
6
  module Fastball
6
7
 
7
8
  # The Fastball::Config generates environment specific configuration files.
8
9
  #
10
+ # == usage
11
+ #
12
+ # Set up your application's configuration templates and +app_config.yml+ file
13
+ # as described below, then run the following rake task:
14
+ #
15
+ # `rake fastball:config`
16
+ #
9
17
  # == Conventions
10
18
  #
11
19
  # Fastball looks for ERB configuration templates in the following locations
@@ -54,7 +62,7 @@ module Fastball
54
62
  #
55
63
  # !!!yaml
56
64
  # ---
57
- # <%= staging %>:
65
+ # <%= rails_env %>:
58
66
  # adapter: mysql2
59
67
  # host: <%= db.host %>
60
68
  # username: <%= db.username %>
@@ -64,6 +72,7 @@ module Fastball
64
72
  #
65
73
  # !!!yaml
66
74
  # ---
75
+ # rails_env: staging
67
76
  # db:
68
77
  # host: localhost
69
78
  # username: dbuser
@@ -104,9 +113,17 @@ module Fastball
104
113
  end
105
114
 
106
115
  def load_config_values
107
- @config ||= HashDot.new YAML.load(File.read('app_config.yml'))
108
- rescue
109
- raise MissingAppConfig.new("expecting app_config.yml to exist in the current directory")
116
+ @config ||= HashDot.new load_config_hash
117
+ end
118
+
119
+ def load_config_hash
120
+ if File.exists?('app_config.yml')
121
+ YAML.load File.read('app_config.yml')
122
+ elsif File.exists?('app_config.json')
123
+ JSON.parse File.read('app_config.json')
124
+ else
125
+ raise MissingAppConfig.new("expecting app_config.yml to exist in the current directory")
126
+ end
110
127
  end
111
128
 
112
129
  def render_template(path)
@@ -1,3 +1,3 @@
1
1
  module Fastball
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastball
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Bach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-29 00:00:00.000000000 Z
11
+ date: 2015-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,3 +117,4 @@ signing_key:
117
117
  specification_version: 4
118
118
  summary: The safest, fastest way to build and deploy dynamic applications.
119
119
  test_files: []
120
+ has_rdoc: