masshtab_dev_tools 0.0.1 → 0.0.2

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTRkNDRiYmNhOWU5MjNmZDMwYmZiZTBjNzliMGM4ZWQ1MThmZjYzYQ==
4
+ MDMyNWJhYTAwYzBhYjM4YmNhYzIwMTNjODI4OTcwMGJmZmNhMzJmYQ==
5
5
  data.tar.gz: !binary |-
6
- OWRjMmU0ZTQwMzNhMDE0OGNhNjQxZmYwY2E4M2E3MWY1ODIzYzY3Mw==
6
+ YmYzZThiN2JiZGIxMWYwYjg2YmJkYTEwMDM3Y2I4N2Y5YTY1ODY3YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- M2IyZGI2NGQxNDdjMjUxNTRhMTg5MzYwOTdhNzQwNThjYjQxODk3MDY2Zjcx
10
- MGQ0YTk1MGQxOTkzMmViZDJhODc3ZTViNmVmZWQ2M2NhZDI0MDg1ZTQ2NjAx
11
- YmU1ZThkZGRhMDdhNDU2MWFmYjk0ZjYxZTk2NzRlYzVjZDIwYzU=
9
+ YjQ0ODkwZGZjNzM5NTM0Y2Q3NTMxNzI0NTQ5MTE3OGFkZGIxMWFkZTI1NDBm
10
+ ZTQ3YmY2ZGM5ODA2ZTJmMjE1MTFmYjcxNTczZjgyMzI1ODU4MzE3ZjkyMDJi
11
+ ZjgzYTlmNzk0ZTA3ODgyOGFmM2FlZjU0YTA2ZmYyYjEzMTY4Y2E=
12
12
  data.tar.gz: !binary |-
13
- MjFiOTViOThkMmU2NjVmYmUwNTFjYTBiMGFlYWE5OTlmMzYyZmU2NDliZjk3
14
- ZTE0MzhkOWRkOGNkMWE1ZjE0MGUxNWVjOWNiODUwY2RkYTlmMGNmYTZmNDdh
15
- ZWQ0ZTcxMjFkMGQ4MjgyZTkzY2JmZmE1NTEyMmViMjYwNjU5OTE=
13
+ NWIwNzFjNmYyNGU2MTNkMGRmZDE5YjY3ZjU5NTIwYWYwOTkxYWE5NTk2NTU0
14
+ OTI3NWYzM2U3OGU0YTkwMDhjMTJiZDJlM2MzM2E3ODA4YTY0Y2Q3MWVmOTQw
15
+ MDg4ZjI4NDA0NmRjOTgxMTNiMDA3NjY4ZGQ0NjA5NWY1ZDc5YzQ=
data/README.md CHANGED
@@ -29,7 +29,6 @@ From project folder:
29
29
  [--branch=BRANCH] # Branch name to deploy from
30
30
  # Default: master
31
31
  [--application-name=APPLICATION_NAME] # Name of rails application
32
- # Default: simple_site
33
32
 
34
33
  Runtime options:
35
34
  -f, [--force] # Overwrite files that already exist
@@ -40,6 +39,21 @@ From project folder:
40
39
  For example:
41
40
  rails g masshtab:deploy alex example.com
42
41
 
42
+ ### Database configuration
43
+
44
+ rails generate masshtab:database [options]
45
+
46
+ Options:
47
+ [--application-name=APPLICATION_NAME] # Rails application name
48
+
49
+ Runtime options:
50
+ -f, [--force] # Overwrite files that already exist
51
+ -p, [--pretend] # Run but do not make any changes
52
+ -q, [--quiet] # Suppress status output
53
+ -s, [--skip] # Skip files that already exist
54
+
55
+ Generates database.yml configured on mysql2 for OS X and linux
56
+
43
57
  ## Contributing
44
58
 
45
59
  1. Fork it
data/bin/make-ctags ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler'
4
+ paths = Bundler.load.specs.map(&:full_gem_path)
5
+ system("ctags -R -f .gemtags #{paths.join(' ')}")
@@ -0,0 +1 @@
1
+ Generates database.yml configured on mysql2 for OS X and linux
@@ -0,0 +1,16 @@
1
+ module Masshtab
2
+ class DatabaseGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ class_option :application_name, type: :string, default: Rails.application.class.parent_name.underscore, desc: 'Rails application name'
6
+
7
+ def mysql2_gem
8
+ gem 'mysql2'
9
+ end
10
+
11
+ def database_yml
12
+ template 'database.yml', Rails.root.join('config', 'database.yml')
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,44 @@
1
+ # MySQL. Versions 4.1 and 5.0 are recommended.
2
+ #
3
+ # Install the MYSQL driver
4
+ # gem install mysql2
5
+ #
6
+ # Ensure the MySQL gem is defined in your Gemfile
7
+ # gem 'mysql2'
8
+ #
9
+ # And be sure to use new-style password hashing:
10
+ # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
+
12
+ <%% socket = RUBY_PLATFORM.downcase.include?('darwin') ? '/tmp/mysqld.sock' : '/var/run/mysqld/mysqld.sock' %>
13
+ development:
14
+ adapter: mysql2
15
+ encoding: utf8
16
+ reconnect: false
17
+ database: <%= options.application_name %>_development
18
+ pool: 5
19
+ username: root
20
+ password:
21
+ socket: <%%= socket %>
22
+
23
+ # Warning: The database defined as "test" will be erased and
24
+ # re-generated from your development database when you run "rake".
25
+ # Do not set this db to the same as development or production.
26
+ test:
27
+ adapter: mysql2
28
+ encoding: utf8
29
+ reconnect: false
30
+ database: <%= options.application_name %>_test
31
+ pool: 5
32
+ username: root
33
+ password:
34
+ socket: <%%= socket %>
35
+
36
+ production:
37
+ adapter: mysql2
38
+ encoding: utf8
39
+ reconnect: false
40
+ database: <%= options.application_name %>_production
41
+ pool: 5
42
+ username: root
43
+ password:
44
+ socket: <%%= socket %>
@@ -1,3 +1,3 @@
1
1
  module MasshtabDevTools
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -8,8 +8,11 @@ Gem::Specification.new do |spec|
8
8
  spec.version = MasshtabDevTools::VERSION
9
9
  spec.authors = ["Sergey Kucher"]
10
10
  spec.email = ["s.e.kucher@gmail.com"]
11
- spec.description = 'Some useful development tools to masshtab company'
12
- spec.summary = "- rails deployment generator"
11
+ spec.description = 'Tools for specific company tasks'
12
+ spec.summary = <<-SUMM
13
+ - rails deployment generator
14
+ - database configuration generator
15
+ SUMM
13
16
  spec.homepage = "https://github.com/sergey-kucher/masshtab_dev_tools"
14
17
  spec.license = "MIT"
15
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: masshtab_dev_tools
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
  - Sergey Kucher
@@ -52,10 +52,11 @@ dependencies:
52
52
  - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: Some useful development tools to masshtab company
55
+ description: Tools for specific company tasks
56
56
  email:
57
57
  - s.e.kucher@gmail.com
58
- executables: []
58
+ executables:
59
+ - make-ctags
59
60
  extensions: []
60
61
  extra_rdoc_files: []
61
62
  files:
@@ -64,6 +65,10 @@ files:
64
65
  - LICENSE.txt
65
66
  - README.md
66
67
  - Rakefile
68
+ - bin/make-ctags
69
+ - lib/generators/masshtab/database/USAGE
70
+ - lib/generators/masshtab/database/database_generator.rb
71
+ - lib/generators/masshtab/database/templates/database.yml
67
72
  - lib/generators/masshtab/deploy/USAGE
68
73
  - lib/generators/masshtab/deploy/deploy_generator.rb
69
74
  - lib/generators/masshtab/deploy/templates/Capfile
@@ -95,6 +100,6 @@ rubyforge_project:
95
100
  rubygems_version: 2.0.3
96
101
  signing_key:
97
102
  specification_version: 4
98
- summary: ! '- rails deployment generator'
103
+ summary: ! '- rails deployment generator - database configuration generator'
99
104
  test_files: []
100
105
  has_rdoc: