biran 0.1.5 → 0.1.6

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: 286305900b4cf192ffa7a6444985c33e6bfb45b8
4
- data.tar.gz: 2857092b68a91e5a85ec1e7bf163882b5f8c3a8d
3
+ metadata.gz: cbbf6682aad11d3d9954df25555baa94be850624
4
+ data.tar.gz: 39016c642ec0bce21ca5394275271cd7409632cb
5
5
  SHA512:
6
- metadata.gz: e1386c8e9fdab3ae0ef50b93c12d58add8832694e45ba1fd8aba43bbfbfe6699e1ea0a6a92989cbb308fff31ece40640e64c2b53ae153e4090cf2c95155b6e5a
7
- data.tar.gz: 7cc61c1f29e97ddbea3f8220bf9ae1bb5f6fc13c7f91cd946db34162acada2a5584c33a55e353d18ed841a3f655600f1d9ac053e0bfc0ca92e23f0f04b246151
6
+ metadata.gz: 2379b8246e3690e8851d5204a5d85a2e6bbcdbc7c154e6222aec125232245586e59ac1818a8ac9ffcf576be8be46c0903dc5ab46d098749b97127cba2a29fd14
7
+ data.tar.gz: 670cebdc1b49959dc578e142d47b16ceb53f022bc7f08cf52b71a4853cdf1ac6c4acacc4fe6c9684550ffeee476eb01a1bf792c1bee2cb5fdfe19f13322fded8
data/README.md CHANGED
@@ -6,7 +6,7 @@ That guy that creates the config files for every new proyect.
6
6
 
7
7
  This is a simple proof of concept on the configuration files we use in most of our rails/ruby projects.
8
8
 
9
- This version will look for an `app_config.yml` file on `config` folder in the project root.
9
+ This version will look for an `app_config.yml` file in `config` folder in the project root.
10
10
 
11
11
  # TODO:
12
12
 
@@ -15,6 +15,27 @@ This version will look for an `app_config.yml` file on `config` folder in the pr
15
15
  - Add option for server config, right now only creates nginx vhost file and mysql database files for rails AR projects.
16
16
  - More stuff
17
17
 
18
+ # Use
19
+ In a rails app, simply include the gem in your Gemfile:
20
+ ```
21
+ gem 'biran'
22
+ ```
23
+
24
+ In a non-rails app, you will need to do some extra work to make the tasks available to rake. In your Rakefile you will need to manually include things.
25
+ Here is a minimal Rakefile for a basic ruby app that includes the biran tasks along with any local tasks in `lib/tasks`
26
+ ```
27
+ require 'bundler/setup'
28
+ Bundler.require
29
+
30
+ biran_gem = Gem::Specification.find_by_name 'biran'
31
+ Dir["#{biran_gem.gem_dir}/lib/tasks/*.rake"].each do |file|
32
+ Rake::load_rakefile(file)
33
+ end
34
+
35
+ $LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
36
+
37
+ Dir.glob('lib/tasks/*.rake').each {|r| import r}
38
+ ```
18
39
 
19
40
  # Configuration
20
41
 
@@ -249,14 +270,13 @@ Generally not needed to configure, but available. Used to prevent defined top le
249
270
  Default:**
250
271
  ```
251
272
  {
252
- vhost: {extension: '.conf'},
253
- database: {extension: '.yml'}
273
+ vhost: {extension: '.conf'}
254
274
  }
255
275
  ```
256
276
  **Available in: config file, initializer**
257
277
 
258
278
  This config option defines which files you want to be available to generate as part of the config:generate task. Each file listed will get its own task and will be run when `rake config:generate` is run.
259
- The default config will generate `config/vhost.conf` and `config/database.yml`. By default, all files will be generated in the `config` directory. You can override this in the options.
279
+ The default config will generate `config/vhost.conf` only. By default, all files will be generated in the `config` directory. You can override this in the options.
260
280
  Basic exmple from `config/app_config.yml`:
261
281
  ```
262
282
  app:
@@ -1,3 +1,6 @@
1
+ require 'yaml'
2
+ require 'erb'
3
+ require 'active_support/core_ext/hash'
1
4
  require 'biran/config_defaults'
2
5
  require 'biran/config'
3
6
  require 'biran/erb_config'
@@ -46,8 +46,7 @@ module Biran
46
46
 
47
47
  def files_to_generate
48
48
  {
49
- vhost: {extension: '.conf'},
50
- database: {extension: '.yml'}
49
+ vhost: {extension: '.conf'}
51
50
  }
52
51
  end
53
52
 
@@ -54,7 +54,7 @@ module Biran
54
54
  end
55
55
 
56
56
  def default_db_config_file
57
- Rails.root.join(configuration.config_dirname, configuration.db_config_filename)
57
+ File.join(config_dir, configuration.db_config_filename)
58
58
  end
59
59
 
60
60
  def use_capistrano?
@@ -121,7 +121,7 @@ module Biran
121
121
  lambda do |file, _|
122
122
  files_list[file] ||= {extension: ''}
123
123
  ext = files_list[file].fetch(:extension, '').strip
124
- ext.prepend('.') unless ext.starts_with?('.') || ext.empty?
124
+ ext.prepend('.') unless ext.start_with?('.') || ext.empty?
125
125
  files_list[file][:extension] = ext
126
126
  end
127
127
  end
@@ -1,3 +1,3 @@
1
1
  module Biran
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biran
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - javierg
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-01-25 00:00:00.000000000 Z
13
+ date: 2018-03-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties
@@ -26,6 +26,20 @@ dependencies:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: activesupport
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
29
43
  - !ruby/object:Gem::Dependency
30
44
  name: rails
31
45
  requirement: !ruby/object:Gem::Requirement