motion-figaro 0.1.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 +7 -0
- data/.gitignore +11 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +58 -0
- data/Rakefile +2 -0
- data/app/app_delegate.rb +7 -0
- data/config/application.yml +7 -0
- data/lib/motion/figaro.rb +9 -0
- data/lib/motion/figaro/rakefile.rb +48 -0
- data/lib/motion/figaro/version.rb +5 -0
- data/motion-figaro.gemspec +27 -0
- metadata +98 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 815826d4f8cfa97b67b9c51ff0101a17543bdc86
|
4
|
+
data.tar.gz: c278d64b2f49d0132dc1b4a26fca81b24249a98c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c4a584947faeea86db68539846cd6265281a9ef32337e683b548709a574c8ddb800c6f71893127f2843b603a7a1314d8ac7f87526798161e6a48ecfb4b29b732
|
7
|
+
data.tar.gz: 6cf2859998bf0a87e58addd1c07b5c7fd283d1b670b9270c5b65ed18e44532784e29936a1f2352cf2fcbe33953b3518d745c0a9158dfbd734326bb70bf305715
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Katana Code Ltd.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# Motion::Figaro
|
2
|
+
|
3
|
+
A clone of the [Figaro](https://github.com/laserlemon/figaro) gem for RubyMotion apps.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'motion-figaro'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install motion-figaro
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Create a YAML file for your app's configuration variables (API keys, secrets, provisioning profiles, etc.) in `config/application.yml`.
|
24
|
+
|
25
|
+
Configurations can be set globally, or for specific environments:
|
26
|
+
|
27
|
+
GOOGLE_MAPS_API_KEY: "7381a978f7dd7f9a1117"
|
28
|
+
BRAINTREE_KEY: "dd7f9a11177381a978f7"
|
29
|
+
PROVISIONING_PROFILE: "/Users/Bodacious/Library/MobileDevice/Provisioning Profiles/xxx-xxxxx-xxxxx.mobileprovision"
|
30
|
+
|
31
|
+
|
32
|
+
release:
|
33
|
+
# This will override the general one above
|
34
|
+
PROVISIONING_PROFILE: "/Users/Bodacious/Library/MobileDevice/Provisioning Profiles/xxx-xxxxx-xxxxx.mobileprovision"
|
35
|
+
|
36
|
+
## Development
|
37
|
+
|
38
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
39
|
+
|
40
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
41
|
+
|
42
|
+
## Credit
|
43
|
+
|
44
|
+
This gem was created by [Katana](http://katanacode.com/).
|
45
|
+
|
46
|
+
Most of the heavy work is done by [@clayallsopp](https://githhub.com/clayallsopp)'s [motion-env](https://github.com/clayallsopp/motion-env)
|
47
|
+
|
48
|
+
Based on the [Figaro gem](https://github.com/laserlemon/figaro) concept created by [Steve Richert](https://github.com/laserlemon/)
|
49
|
+
|
50
|
+
## Contributing
|
51
|
+
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Bodacious/motion-figaro.
|
53
|
+
|
54
|
+
|
55
|
+
## License
|
56
|
+
|
57
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
58
|
+
|
data/Rakefile
ADDED
data/app/app_delegate.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require "yaml"
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'bundler'
|
7
|
+
Bundler.require
|
8
|
+
rescue LoadError
|
9
|
+
end
|
10
|
+
|
11
|
+
CONFIG_FILE_PATH = "./config/application.yml".freeze
|
12
|
+
|
13
|
+
unless File.exist?(CONFIG_FILE_PATH)
|
14
|
+
warn "Figaro-Motion expects a config file to exist in #{CONFIG_FILE_PATH}." \
|
15
|
+
"Please create this file and try again."
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
|
19
|
+
Motion::Project::App.setup do |app|
|
20
|
+
|
21
|
+
# Configs for all environments
|
22
|
+
application_hash = YAML.load(File.open(CONFIG_FILE_PATH))
|
23
|
+
# Configs for the spec environment
|
24
|
+
spec_hash = Hash(application_hash.delete("spec"))
|
25
|
+
# Configs for the development environment
|
26
|
+
development_hash = Hash(application_hash.delete("development"))
|
27
|
+
# Configs for the release environment
|
28
|
+
release_hash = Hash(application_hash.delete("release"))
|
29
|
+
|
30
|
+
app.development do
|
31
|
+
application_hash.merge!(development_hash)
|
32
|
+
end
|
33
|
+
|
34
|
+
app.release do
|
35
|
+
application_hash.merge!(release_hash)
|
36
|
+
end
|
37
|
+
|
38
|
+
app.spec_mode do
|
39
|
+
application_hash.merge!(spec_hash)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Update the ENV hash with the settings from the application file
|
43
|
+
application_hash.each do |key,value|
|
44
|
+
ENV[key.to_s] = value
|
45
|
+
app.env[key] = value
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'motion/figaro/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "motion-figaro"
|
8
|
+
spec.version = Motion::Figaro::VERSION
|
9
|
+
spec.authors = ["Bodacious"]
|
10
|
+
spec.email = ["bodacious@katanacode.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Simple RubyMotion app configuration using ENV and a single YAML file}
|
13
|
+
spec.description = %q{Keep your application configuration separate from your codebase with this simple, lightweight gem.}
|
14
|
+
spec.homepage = "https://github.com/KatanaCode/motion-figaro"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency "motion-env"
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.13"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: motion-figaro
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bodacious
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: motion-env
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.13'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.13'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description: Keep your application configuration separate from your codebase with
|
56
|
+
this simple, lightweight gem.
|
57
|
+
email:
|
58
|
+
- bodacious@katanacode.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- Gemfile
|
65
|
+
- LICENSE.txt
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- app/app_delegate.rb
|
69
|
+
- config/application.yml
|
70
|
+
- lib/motion/figaro.rb
|
71
|
+
- lib/motion/figaro/rakefile.rb
|
72
|
+
- lib/motion/figaro/version.rb
|
73
|
+
- motion-figaro.gemspec
|
74
|
+
homepage: https://github.com/KatanaCode/motion-figaro
|
75
|
+
licenses:
|
76
|
+
- MIT
|
77
|
+
metadata: {}
|
78
|
+
post_install_message:
|
79
|
+
rdoc_options: []
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
requirements: []
|
93
|
+
rubyforge_project:
|
94
|
+
rubygems_version: 2.5.1
|
95
|
+
signing_key:
|
96
|
+
specification_version: 4
|
97
|
+
summary: Simple RubyMotion app configuration using ENV and a single YAML file
|
98
|
+
test_files: []
|