dump_create 0.1.1 → 0.1.3

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: 684269d457524edab2abd355d1fea928e02a4d13
4
- data.tar.gz: b0542a5698cac1f046150bf1ed54fd456f0541a0
3
+ metadata.gz: a2c574d02eb2c8272c69691f70a85185968b443a
4
+ data.tar.gz: 9677acd0a392d32bd595f345c7364e7ca1c05f74
5
5
  SHA512:
6
- metadata.gz: 803b1bc6a95ac0b16e25824c2425166d9714347b5a38a47518894d9c58316371ac572a1ab3bf73ba2da8b9f1999782ea8e5389a8fb9da2eb3187033ac6f9a665
7
- data.tar.gz: b3c71bac75fe3474d6a1361c37d46d9155004e7efce94fa01d4810f497ab00f6c73ee114dc6927ded181525731e8ed0633cdb32010b50755f91fccabb17d6f13
6
+ metadata.gz: 588544876a3e08634d92bfd9a975d1123415a0f10e51195e32e959fecaf4e3245182088d2f4467ca7982c3710316e739e947a884a24bb01cd19a07525f791709
7
+ data.tar.gz: b6b9297752dcf07bbab9d6196eb4a85c61b49da603ccbce3c8a57e27470e572e0bcdeef87fecb70d54e610a3f33031606ba86a4cffe0702e1f2f9f5790a51a07
@@ -6,7 +6,7 @@ require 'rails/all'
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = 'dump_create'
9
- s.version = '0.1.1'
9
+ s.version = '0.1.3'
10
10
  s.date = '2016-03-11'
11
11
  s.summary = "Create Dump file"
12
12
  s.description = "create dump file from list method"
@@ -1,20 +1,15 @@
1
1
 
2
2
  class Dump
3
- def self.show
4
- puts 'successfully running Dump.show method'
5
- end
6
3
 
7
- def self.construct
8
- config = Rails.configuration.database_configuration
9
- @database = config[Rails.env]["database"]
10
- @username = config[Rails.env]["username"]
11
- @password = config[Rails.env]["password"]
12
- @host = config[Rails.env]["host"]
4
+ def self.construct(username, database, *host)
5
+ unless File.directory?('temporary')
6
+ system 'mkdir temporary'
7
+ end
13
8
 
14
- unless @password
15
- system "mysqldump -u #{@username} #{@database} > $(date +%F__%T).sql"
9
+ if host.size==2
10
+ system "mysqldump -u #{username} -p#{host[0]} -h#{host[1]} #{database} > temporary/$(date +%F__%T).sql"
16
11
  else
17
- system "mysqldump -u #{@username} -p#{@password} #{@database} > $(date +%F__%T).sql"
12
+ system "mysqldump -u #{username} -h#{host[0]} #{database} > temporary/$(date +%F__%T).sql"
18
13
  end
19
14
 
20
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dump_create
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GR