poring_backup 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +34 -0
  4. data/lib/generators/poring_backup/install_generator.rb +13 -0
  5. data/lib/generators/poring_backup/templates/init_backup.rb +28 -0
  6. data/lib/poring_backup.rb +24 -0
  7. data/lib/poring_backup/callback.rb +29 -0
  8. data/lib/poring_backup/database.rb +44 -0
  9. data/lib/poring_backup/databases/postgresql.rb +81 -0
  10. data/lib/poring_backup/logger.rb +45 -0
  11. data/lib/poring_backup/railtie.rb +10 -0
  12. data/lib/poring_backup/setting.rb +64 -0
  13. data/lib/poring_backup/storage.rb +11 -0
  14. data/lib/poring_backup/storages/s3.rb +66 -0
  15. data/lib/poring_backup/version.rb +3 -0
  16. data/lib/tasks/poring_backup_tasks.task +14 -0
  17. data/test/dummy/README.rdoc +28 -0
  18. data/test/dummy/Rakefile +6 -0
  19. data/test/dummy/app/assets/javascripts/application.js +13 -0
  20. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  21. data/test/dummy/app/controllers/application_controller.rb +5 -0
  22. data/test/dummy/app/helpers/application_helper.rb +2 -0
  23. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/test/dummy/bin/bundle +3 -0
  25. data/test/dummy/bin/rails +4 -0
  26. data/test/dummy/bin/rake +4 -0
  27. data/test/dummy/bin/setup +29 -0
  28. data/test/dummy/config.ru +4 -0
  29. data/test/dummy/config/application.rb +26 -0
  30. data/test/dummy/config/boot.rb +5 -0
  31. data/test/dummy/config/database.sample.yml +16 -0
  32. data/test/dummy/config/database.travis.yml +18 -0
  33. data/test/dummy/config/database.yml +16 -0
  34. data/test/dummy/config/environment.rb +5 -0
  35. data/test/dummy/config/environments/development.rb +41 -0
  36. data/test/dummy/config/environments/production.rb +79 -0
  37. data/test/dummy/config/environments/test.rb +42 -0
  38. data/test/dummy/config/initializers/assets.rb +11 -0
  39. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  40. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  41. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  42. data/test/dummy/config/initializers/inflections.rb +16 -0
  43. data/test/dummy/config/initializers/mime_types.rb +4 -0
  44. data/test/dummy/config/initializers/poring_backup.rb +23 -0
  45. data/test/dummy/config/initializers/session_store.rb +3 -0
  46. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  47. data/test/dummy/config/locales/en.yml +23 -0
  48. data/test/dummy/config/routes.rb +56 -0
  49. data/test/dummy/config/secrets.sample.yml +22 -0
  50. data/test/dummy/config/secrets.yml +22 -0
  51. data/test/dummy/db/schema.rb +19 -0
  52. data/test/dummy/log/backup_development.log +139 -0
  53. data/test/dummy/log/backup_test.log +27 -0
  54. data/test/dummy/log/development.log +3 -0
  55. data/test/dummy/log/test.log +1524 -0
  56. data/test/dummy/public/404.html +67 -0
  57. data/test/dummy/public/422.html +67 -0
  58. data/test/dummy/public/500.html +66 -0
  59. data/test/dummy/public/favicon.ico +0 -0
  60. data/test/dummy/spec/lib/database_spec.rb +46 -0
  61. data/test/dummy/spec/lib/databases/postgresql_spec.rb +85 -0
  62. data/test/dummy/spec/lib/setting_spec.rb +62 -0
  63. data/test/dummy/spec/lib/storage_spec.rb +15 -0
  64. data/test/dummy/spec/lib/storages/s3_spec.rb +43 -0
  65. data/test/dummy/spec/rails_helper.rb +69 -0
  66. data/test/dummy/spec/spec_helper.rb +87 -0
  67. data/test/poring_backup_test.rb +7 -0
  68. data/test/test_helper.rb +19 -0
  69. metadata +219 -0
@@ -0,0 +1,69 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV['RAILS_ENV'] ||= 'test'
3
+ require 'spec_helper'
4
+ require File.expand_path('../../config/environment', __FILE__)
5
+ require 'rspec/rails'
6
+ # Add additional requires below this line. Rails is not loaded until this point!
7
+ require 'fakefs/spec_helpers'
8
+ # require 'vcr'
9
+ # require 'aws-sdk'
10
+
11
+ # Requires supporting ruby files with custom matchers and macros, etc, in
12
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
13
+ # run as spec files by default. This means that files in spec/support that end
14
+ # in _spec.rb will both be required and run as specs, causing the specs to be
15
+ # run twice. It is recommended that you do not name files matching this glob to
16
+ # end with _spec.rb. You can configure this pattern with the --pattern
17
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
18
+ #
19
+ # The following line is provided for convenience purposes. It has the downside
20
+ # of increasing the boot-up time by auto-requiring all files in the support
21
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
22
+ # require only the support files necessary.
23
+ #
24
+ # Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
25
+
26
+ # Checks for pending migrations before tests are run.
27
+ # If you are not using ActiveRecord, you can remove this line.
28
+ ActiveRecord::Migration.maintain_test_schema!
29
+
30
+ # VCR.configure do |c|
31
+ # c.cassette_library_dir = 'fixtures/vcr_cassettes'
32
+ # c.hook_into :fakeweb
33
+ # end
34
+
35
+ # Fixes a missing attribute in Fakeweb's stubbed HTTP client
36
+ # class FakeWeb::StubSocket; attr_accessor :read_timeout end
37
+
38
+ RSpec.configure do |config|
39
+
40
+
41
+ # config.around(:each) do |example|
42
+ # VCR.use_cassette(example.metadata[:full_description]) do
43
+ # example.run
44
+ # end
45
+ # end
46
+
47
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
48
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
49
+
50
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
51
+ # examples within a transaction, remove the following line or assign false
52
+ # instead of true.
53
+ config.use_transactional_fixtures = true
54
+
55
+ # RSpec Rails can automatically mix in different behaviours to your tests
56
+ # based on their file location, for example enabling you to call `get` and
57
+ # `post` in specs under `spec/controllers`.
58
+ #
59
+ # You can disable this behaviour by removing the line below, and instead
60
+ # explicitly tag your specs with their type, e.g.:
61
+ #
62
+ # RSpec.describe UsersController, :type => :controller do
63
+ # # ...
64
+ # end
65
+ #
66
+ # The different available types are documented in the features, such as in
67
+ # https://relishapp.com/rspec/rspec-rails/docs
68
+ config.infer_spec_type_from_file_location!
69
+ end
@@ -0,0 +1,87 @@
1
+ # This file was generated by the `rails generate rspec:install` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # The settings below are suggested to provide a good initial experience
44
+ # with RSpec, but feel free to customize to your heart's content.
45
+ =begin
46
+ # These two settings work together to allow you to limit a spec run
47
+ # to individual examples or groups you care about by tagging them with
48
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
49
+ # get run.
50
+ config.filter_run :focus
51
+ config.run_all_when_everything_filtered = true
52
+
53
+ # Limits the available syntax to the non-monkey patched syntax that is
54
+ # recommended. For more details, see:
55
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
56
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
57
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
58
+ config.disable_monkey_patching!
59
+
60
+ # Many RSpec users commonly either run the entire suite or an individual
61
+ # file, and it's useful to allow more verbose output when running an
62
+ # individual spec file.
63
+ if config.files_to_run.one?
64
+ # Use the documentation formatter for detailed output,
65
+ # unless a formatter has already been configured
66
+ # (e.g. via a command-line flag).
67
+ config.default_formatter = 'doc'
68
+ end
69
+
70
+ # Print the 10 slowest examples and example groups at the
71
+ # end of the spec run, to help surface which specs are running
72
+ # particularly slow.
73
+ config.profile_examples = 10
74
+
75
+ # Run specs in random order to surface order dependencies. If you find an
76
+ # order dependency and want to debug it, you can fix the order by providing
77
+ # the seed, which is printed after each run.
78
+ # --seed 1234
79
+ config.order = :random
80
+
81
+ # Seed global randomization in this process using the `--seed` CLI option.
82
+ # Setting this allows you to use `--seed` to deterministically reproduce
83
+ # test failures related to randomization by passing the same `--seed` value
84
+ # as the one that triggered the failure.
85
+ Kernel.srand config.seed
86
+ =end
87
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class PoringBackupTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, PoringBackup
6
+ end
7
+ end
@@ -0,0 +1,19 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
+ ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
6
+ require "rails/test_help"
7
+
8
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
9
+ # to be shown.
10
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
11
+
12
+ # Load support files
13
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14
+
15
+ # Load fixtures from the engine
16
+ if ActiveSupport::TestCase.respond_to?(:fixture_path=)
17
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
18
+ ActiveSupport::TestCase.fixtures :all
19
+ end
metadata ADDED
@@ -0,0 +1,219 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: poring_backup
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - PiYa
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 4.2.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 4.2.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: pg
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: aws-sdk
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: logging
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.0.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: 2.0.0
69
+ description: Poring Backup is database backup that support rails.
70
+ email:
71
+ - piya23300@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - MIT-LICENSE
77
+ - Rakefile
78
+ - lib/generators/poring_backup/install_generator.rb
79
+ - lib/generators/poring_backup/templates/init_backup.rb
80
+ - lib/poring_backup.rb
81
+ - lib/poring_backup/callback.rb
82
+ - lib/poring_backup/database.rb
83
+ - lib/poring_backup/databases/postgresql.rb
84
+ - lib/poring_backup/logger.rb
85
+ - lib/poring_backup/railtie.rb
86
+ - lib/poring_backup/setting.rb
87
+ - lib/poring_backup/storage.rb
88
+ - lib/poring_backup/storages/s3.rb
89
+ - lib/poring_backup/version.rb
90
+ - lib/tasks/poring_backup_tasks.task
91
+ - test/dummy/README.rdoc
92
+ - test/dummy/Rakefile
93
+ - test/dummy/app/assets/javascripts/application.js
94
+ - test/dummy/app/assets/stylesheets/application.css
95
+ - test/dummy/app/controllers/application_controller.rb
96
+ - test/dummy/app/helpers/application_helper.rb
97
+ - test/dummy/app/views/layouts/application.html.erb
98
+ - test/dummy/bin/bundle
99
+ - test/dummy/bin/rails
100
+ - test/dummy/bin/rake
101
+ - test/dummy/bin/setup
102
+ - test/dummy/config.ru
103
+ - test/dummy/config/application.rb
104
+ - test/dummy/config/boot.rb
105
+ - test/dummy/config/database.sample.yml
106
+ - test/dummy/config/database.travis.yml
107
+ - test/dummy/config/database.yml
108
+ - test/dummy/config/environment.rb
109
+ - test/dummy/config/environments/development.rb
110
+ - test/dummy/config/environments/production.rb
111
+ - test/dummy/config/environments/test.rb
112
+ - test/dummy/config/initializers/assets.rb
113
+ - test/dummy/config/initializers/backtrace_silencers.rb
114
+ - test/dummy/config/initializers/cookies_serializer.rb
115
+ - test/dummy/config/initializers/filter_parameter_logging.rb
116
+ - test/dummy/config/initializers/inflections.rb
117
+ - test/dummy/config/initializers/mime_types.rb
118
+ - test/dummy/config/initializers/poring_backup.rb
119
+ - test/dummy/config/initializers/session_store.rb
120
+ - test/dummy/config/initializers/wrap_parameters.rb
121
+ - test/dummy/config/locales/en.yml
122
+ - test/dummy/config/routes.rb
123
+ - test/dummy/config/secrets.sample.yml
124
+ - test/dummy/config/secrets.yml
125
+ - test/dummy/db/schema.rb
126
+ - test/dummy/log/backup_development.log
127
+ - test/dummy/log/backup_test.log
128
+ - test/dummy/log/development.log
129
+ - test/dummy/log/test.log
130
+ - test/dummy/public/404.html
131
+ - test/dummy/public/422.html
132
+ - test/dummy/public/500.html
133
+ - test/dummy/public/favicon.ico
134
+ - test/dummy/spec/lib/database_spec.rb
135
+ - test/dummy/spec/lib/databases/postgresql_spec.rb
136
+ - test/dummy/spec/lib/setting_spec.rb
137
+ - test/dummy/spec/lib/storage_spec.rb
138
+ - test/dummy/spec/lib/storages/s3_spec.rb
139
+ - test/dummy/spec/rails_helper.rb
140
+ - test/dummy/spec/spec_helper.rb
141
+ - test/poring_backup_test.rb
142
+ - test/test_helper.rb
143
+ homepage: https://github.com/piya23300/poring_backup
144
+ licenses:
145
+ - MIT
146
+ metadata: {}
147
+ post_install_message:
148
+ rdoc_options: []
149
+ require_paths:
150
+ - lib
151
+ required_ruby_version: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - '>='
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ required_rubygems_version: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - '>='
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ requirements: []
162
+ rubyforge_project:
163
+ rubygems_version: 2.2.2
164
+ signing_key:
165
+ specification_version: 4
166
+ summary: backup support rails.
167
+ test_files:
168
+ - test/dummy/app/assets/javascripts/application.js
169
+ - test/dummy/app/assets/stylesheets/application.css
170
+ - test/dummy/app/controllers/application_controller.rb
171
+ - test/dummy/app/helpers/application_helper.rb
172
+ - test/dummy/app/views/layouts/application.html.erb
173
+ - test/dummy/bin/bundle
174
+ - test/dummy/bin/rails
175
+ - test/dummy/bin/rake
176
+ - test/dummy/bin/setup
177
+ - test/dummy/config/application.rb
178
+ - test/dummy/config/boot.rb
179
+ - test/dummy/config/database.sample.yml
180
+ - test/dummy/config/database.travis.yml
181
+ - test/dummy/config/database.yml
182
+ - test/dummy/config/environment.rb
183
+ - test/dummy/config/environments/development.rb
184
+ - test/dummy/config/environments/production.rb
185
+ - test/dummy/config/environments/test.rb
186
+ - test/dummy/config/initializers/assets.rb
187
+ - test/dummy/config/initializers/backtrace_silencers.rb
188
+ - test/dummy/config/initializers/cookies_serializer.rb
189
+ - test/dummy/config/initializers/filter_parameter_logging.rb
190
+ - test/dummy/config/initializers/inflections.rb
191
+ - test/dummy/config/initializers/mime_types.rb
192
+ - test/dummy/config/initializers/poring_backup.rb
193
+ - test/dummy/config/initializers/session_store.rb
194
+ - test/dummy/config/initializers/wrap_parameters.rb
195
+ - test/dummy/config/locales/en.yml
196
+ - test/dummy/config/routes.rb
197
+ - test/dummy/config/secrets.sample.yml
198
+ - test/dummy/config/secrets.yml
199
+ - test/dummy/config.ru
200
+ - test/dummy/db/schema.rb
201
+ - test/dummy/log/backup_development.log
202
+ - test/dummy/log/backup_test.log
203
+ - test/dummy/log/development.log
204
+ - test/dummy/log/test.log
205
+ - test/dummy/public/404.html
206
+ - test/dummy/public/422.html
207
+ - test/dummy/public/500.html
208
+ - test/dummy/public/favicon.ico
209
+ - test/dummy/Rakefile
210
+ - test/dummy/README.rdoc
211
+ - test/dummy/spec/lib/database_spec.rb
212
+ - test/dummy/spec/lib/databases/postgresql_spec.rb
213
+ - test/dummy/spec/lib/setting_spec.rb
214
+ - test/dummy/spec/lib/storage_spec.rb
215
+ - test/dummy/spec/lib/storages/s3_spec.rb
216
+ - test/dummy/spec/rails_helper.rb
217
+ - test/dummy/spec/spec_helper.rb
218
+ - test/poring_backup_test.rb
219
+ - test/test_helper.rb