generate_dump_file 0.1.1 → 0.1.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fa4e54f644beff81582b73ab0201022e361114b
4
- data.tar.gz: 9d39426bcb308338baaf33ea389c725ac80589eb
3
+ metadata.gz: 1abd3f464f7d3b1de4c43a14f2aeeae35c640c26
4
+ data.tar.gz: 6c152ee6a5c6b14110c36fe0483c8b7bf360709f
5
5
  SHA512:
6
- metadata.gz: bb1949967613da54f6c452fe87a9fa0de3e2bce0cb2da6837634ef6d18668a8f2a108b3e2421556dabab21c02aa5585fce196e5d6031f967871a6f7552568b83
7
- data.tar.gz: 8f76cb7a47075cb5f000f1d7b17aff3c3be5d525f110f7499dc4a9e0fe94bb80a1577660d4d096de5061a37f55020c56abd512b1074ad5007d531202b2dd0c0d
6
+ metadata.gz: 729739ba200c9c2f321209cdf152d85dc74d5140efe73662e9f7d4ea168b904d1dda783e54f29d0f5e68c2d5f0ca9569437e8bf4bdcdd3a887ba714c7556bacb
7
+ data.tar.gz: 6c521ea94e34cab20b822d5a11a057e8539682eb931d2f75c166b6c1128d595229b5e07a4a37068e73f185b774604c7c32929172307bd06ac2fd1cc0f18d3764
data/Gemfile.lock ADDED
@@ -0,0 +1,134 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ generate_dump_file (0.1.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actioncable (5.1.5)
10
+ actionpack (= 5.1.5)
11
+ nio4r (~> 2.0)
12
+ websocket-driver (~> 0.6.1)
13
+ actionmailer (5.1.5)
14
+ actionpack (= 5.1.5)
15
+ actionview (= 5.1.5)
16
+ activejob (= 5.1.5)
17
+ mail (~> 2.5, >= 2.5.4)
18
+ rails-dom-testing (~> 2.0)
19
+ actionpack (5.1.5)
20
+ actionview (= 5.1.5)
21
+ activesupport (= 5.1.5)
22
+ rack (~> 2.0)
23
+ rack-test (>= 0.6.3)
24
+ rails-dom-testing (~> 2.0)
25
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
+ actionview (5.1.5)
27
+ activesupport (= 5.1.5)
28
+ builder (~> 3.1)
29
+ erubi (~> 1.4)
30
+ rails-dom-testing (~> 2.0)
31
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
32
+ activejob (5.1.5)
33
+ activesupport (= 5.1.5)
34
+ globalid (>= 0.3.6)
35
+ activemodel (5.1.5)
36
+ activesupport (= 5.1.5)
37
+ activerecord (5.1.5)
38
+ activemodel (= 5.1.5)
39
+ activesupport (= 5.1.5)
40
+ arel (~> 8.0)
41
+ activesupport (5.1.5)
42
+ concurrent-ruby (~> 1.0, >= 1.0.2)
43
+ i18n (~> 0.7)
44
+ minitest (~> 5.1)
45
+ tzinfo (~> 1.1)
46
+ arel (8.0.0)
47
+ builder (3.2.3)
48
+ concurrent-ruby (1.0.5)
49
+ crass (1.0.3)
50
+ diff-lcs (1.3)
51
+ erubi (1.7.1)
52
+ globalid (0.4.1)
53
+ activesupport (>= 4.2.0)
54
+ i18n (0.9.5)
55
+ concurrent-ruby (~> 1.0)
56
+ loofah (2.2.2)
57
+ crass (~> 1.0.2)
58
+ nokogiri (>= 1.5.9)
59
+ mail (2.7.0)
60
+ mini_mime (>= 0.1.1)
61
+ method_source (0.9.0)
62
+ mini_mime (1.0.0)
63
+ mini_portile2 (2.3.0)
64
+ minitest (5.11.3)
65
+ nio4r (2.3.0)
66
+ nokogiri (1.8.2)
67
+ mini_portile2 (~> 2.3.0)
68
+ rack (2.0.4)
69
+ rack-test (0.8.3)
70
+ rack (>= 1.0, < 3)
71
+ rails (5.1.5)
72
+ actioncable (= 5.1.5)
73
+ actionmailer (= 5.1.5)
74
+ actionpack (= 5.1.5)
75
+ actionview (= 5.1.5)
76
+ activejob (= 5.1.5)
77
+ activemodel (= 5.1.5)
78
+ activerecord (= 5.1.5)
79
+ activesupport (= 5.1.5)
80
+ bundler (>= 1.3.0)
81
+ railties (= 5.1.5)
82
+ sprockets-rails (>= 2.0.0)
83
+ rails-dom-testing (2.0.3)
84
+ activesupport (>= 4.2.0)
85
+ nokogiri (>= 1.6)
86
+ rails-html-sanitizer (1.0.4)
87
+ loofah (~> 2.2, >= 2.2.2)
88
+ railties (5.1.5)
89
+ actionpack (= 5.1.5)
90
+ activesupport (= 5.1.5)
91
+ method_source
92
+ rake (>= 0.8.7)
93
+ thor (>= 0.18.1, < 2.0)
94
+ rake (10.5.0)
95
+ rspec (3.7.0)
96
+ rspec-core (~> 3.7.0)
97
+ rspec-expectations (~> 3.7.0)
98
+ rspec-mocks (~> 3.7.0)
99
+ rspec-core (3.7.1)
100
+ rspec-support (~> 3.7.0)
101
+ rspec-expectations (3.7.0)
102
+ diff-lcs (>= 1.2.0, < 2.0)
103
+ rspec-support (~> 3.7.0)
104
+ rspec-mocks (3.7.0)
105
+ diff-lcs (>= 1.2.0, < 2.0)
106
+ rspec-support (~> 3.7.0)
107
+ rspec-support (3.7.1)
108
+ sprockets (3.7.1)
109
+ concurrent-ruby (~> 1.0)
110
+ rack (> 1, < 3)
111
+ sprockets-rails (3.2.1)
112
+ actionpack (>= 4.0)
113
+ activesupport (>= 4.0)
114
+ sprockets (>= 3.0.0)
115
+ thor (0.20.0)
116
+ thread_safe (0.3.6)
117
+ tzinfo (1.2.5)
118
+ thread_safe (~> 0.1)
119
+ websocket-driver (0.6.5)
120
+ websocket-extensions (>= 0.1.0)
121
+ websocket-extensions (0.1.3)
122
+
123
+ PLATFORMS
124
+ ruby
125
+
126
+ DEPENDENCIES
127
+ bundler (~> 1.16)
128
+ generate_dump_file!
129
+ rails
130
+ rake (~> 10.0)
131
+ rspec (~> 3.0)
132
+
133
+ BUNDLED WITH
134
+ 1.16.1
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # GenerateDumpFile
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/generate_dump_file`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Create dump file in temporary folder of root directory, if folder not present in directory then it will create one. Open interactive prompt by typing 'irb' and
4
+ $ require 'generate_dump_file'.
5
+ also do, $ require File.expand_path('../config/environment', __FILE__)
6
+ and then run GenerateDumpFile.create
6
7
 
7
8
  ## Installation
8
9
 
@@ -37,7 +38,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
37
38
 
38
39
  ## Contributing
39
40
 
40
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/generate_dump_file.
41
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jainnimish7/generate_dump_file.
41
42
 
42
43
  ## License
43
44
 
@@ -10,8 +10,10 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["jainnimish7@gmail.com"]
11
11
 
12
12
  spec.summary = %q{Create dump file in temporary directoy }
13
- spec.description = %q{Create dump file in temporary folder of root directory, if folder not present in dir then it'll create one. Usage: open 'irb' and require 'generate_dump_file'}
14
- # spec.homepage = "TODO: Put your gem's website or public repo URL here."
13
+ spec.description = %q{Create dump file in temporary folder of root directory, if folder not present in dir then it will create one.
14
+ Usage: open interactive prompt by typing 'irb' and require 'generate_dump_file'.
15
+ again, require File.expand_path('../config/environment', __FILE__) and then run GenerateDumpFile.create }
16
+ spec.homepage = "https://github.com/jainnimish7/generate_dump_file"
15
17
  spec.license = "techracers"
16
18
 
17
19
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -3,7 +3,7 @@ require 'rails'
3
3
 
4
4
  module GenerateDumpFile
5
5
  def self.hello
6
- puts "Testing gem method"
6
+ puts "Hello User"
7
7
  end
8
8
 
9
9
  def self.create
@@ -14,23 +14,28 @@ module GenerateDumpFile
14
14
  database = config[Rails.env]["database"]
15
15
  username = config[Rails.env]["username"]
16
16
  password = config[Rails.env]["password"]
17
-
17
+ flag = false
18
18
  if config.present?
19
19
  if config[Rails.env]["adapter"] == "postgresql"
20
20
  if host.present?
21
21
  system "pg_dump -F c -v -U #{username} -h #{host} #{database} -f temporary/$(date +%F__%T).psql"
22
+ flag = true
22
23
  else
23
24
  system "pg_dump -F c -v -U #{username} #{database} -f temporary/$(date +%F__%T).psql"
25
+ flag = true
24
26
  end
25
27
  elsif config[Rails.env]["adapter"] == "mysql2"
26
28
  if host.present?
27
29
  system "mysqldump -u #{username} -p#{password} -h#{host} #{database} > temporary/$(date +%F__%T).sql"
30
+ flag = true
28
31
  else
29
32
  system "mysqldump -u #{username} -p#{password} #{database} > temporary/$(date +%F__%T).sql"
33
+ flag = true
30
34
  end
31
35
  else
32
36
  puts "Unknown database "
33
37
  end
38
+ puts "Successfully created dump file in temporary directory." if flag
34
39
  else
35
40
  puts "Please require this: require File.expand_path('../config/environment', __FILE__)"
36
41
  end
@@ -1,3 +1,3 @@
1
1
  module GenerateDumpFile
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: generate_dump_file
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nimish Jain
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-27 00:00:00.000000000 Z
11
+ date: 2018-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,8 +52,10 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- description: 'Create dump file in temporary folder of root directory, if folder not
56
- present in dir then it''ll create one. Usage: open ''irb'' and require ''generate_dump_file'''
55
+ description: "Create dump file in temporary folder of root directory, if folder not
56
+ present in dir then it will create one. \n Usage: open
57
+ interactive prompt by typing 'irb' and require 'generate_dump_file'.\n again,
58
+ require File.expand_path('../config/environment', __FILE__) and then run GenerateDumpFile.create "
57
59
  email:
58
60
  - jainnimish7@gmail.com
59
61
  executables: []
@@ -64,6 +66,7 @@ files:
64
66
  - ".rspec"
65
67
  - ".travis.yml"
66
68
  - Gemfile
69
+ - Gemfile.lock
67
70
  - LICENSE.txt
68
71
  - README.md
69
72
  - Rakefile
@@ -72,7 +75,7 @@ files:
72
75
  - generate_dump_file.gemspec
73
76
  - lib/generate_dump_file.rb
74
77
  - lib/generate_dump_file/version.rb
75
- homepage:
78
+ homepage: https://github.com/jainnimish7/generate_dump_file
76
79
  licenses:
77
80
  - techracers
78
81
  metadata: {}