bibliotech 0.6.0 → 0.7.0
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 +4 -4
- data/lib/bibliotech/application.rb +2 -1
- data/lib/bibliotech/cli.rb +6 -0
- data/lib/bibliotech/config.rb +2 -2
- data/lib/bibliotech/rake_lib.rb +1 -0
- data/spec/bibliotech/config_spec.rb +25 -1
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 804c1ec222cfcce3715ea70417d454d27f101d28
         | 
| 4 | 
            +
              data.tar.gz: 9192572724a7195c5fae93b584ac4918faf7c1bd
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: c06ed0372a7bbb3bca55b97679876745fdfa41fca057b918c237fe022ff8b0535830e47cfee74afeb9892e04a5790f749ef780d2f22e345664adbbdd5628fc63
         | 
| 7 | 
            +
              data.tar.gz: 92f31cb44424be653504b1bf5c7cab93ddf20b1600b7960072d51a22d265a64bebd72ad47ce28a62bb329a8f4cf0f48b0ff25913f73f28a75b212e3b55152a77
         | 
    
        data/lib/bibliotech/cli.rb
    CHANGED
    
    | @@ -21,6 +21,12 @@ module BiblioTech | |
| 21 21 | 
             
                  app.import(:backups => { :filename => file })
         | 
| 22 22 | 
             
                end
         | 
| 23 23 |  | 
| 24 | 
            +
                desc "backup", "Create a database backup if needed"
         | 
| 25 | 
            +
                def backup()
         | 
| 26 | 
            +
                  app = App.new
         | 
| 27 | 
            +
                  app.create_backup
         | 
| 28 | 
            +
                end
         | 
| 29 | 
            +
             | 
| 24 30 | 
             
                desc "config", "Dumps the configuration as parsed"
         | 
| 25 31 | 
             
                def config
         | 
| 26 32 | 
             
                  require 'yaml'
         | 
    
        data/lib/bibliotech/config.rb
    CHANGED
    
    
    
        data/lib/bibliotech/rake_lib.rb
    CHANGED
    
    | @@ -81,6 +81,7 @@ module BiblioTech | |
| 81 81 | 
             
                    namespace :remote_sync do
         | 
| 82 82 | 
             
                      desc "Pull the latest DB dump from the remote server into our local DB"
         | 
| 83 83 | 
             
                      task :down do
         | 
| 84 | 
            +
                        app.remote_cli(remote, "create_backup").must_succeed!
         | 
| 84 85 | 
             
                        result = app.remote_cli(remote, "latest")
         | 
| 85 86 | 
             
                        result.must_succeed!
         | 
| 86 87 | 
             
                        filename = result.stdout.chomp
         | 
| @@ -6,10 +6,11 @@ module BiblioTech | |
| 6 6 | 
             
              describe Config do
         | 
| 7 7 | 
             
                include FileSandbox
         | 
| 8 8 |  | 
| 9 | 
            -
                describe " | 
| 9 | 
            +
                describe "database.yml" do
         | 
| 10 10 | 
             
                  before :each do
         | 
| 11 11 | 
             
                    sandbox.new :file => 'config/database.yml', :with_contents => YAML::dump(
         | 
| 12 12 | 
             
                      {
         | 
| 13 | 
            +
             | 
| 13 14 | 
             
                        "development" =>
         | 
| 14 15 | 
             
                        { "username" => 'root',
         | 
| 15 16 | 
             
                          "database"  => 'dev_db',
         | 
| @@ -128,6 +129,29 @@ module BiblioTech | |
| 128 129 | 
             
                    end
         | 
| 129 130 | 
             
                  end
         | 
| 130 131 |  | 
| 132 | 
            +
                  context "environment overrides" do
         | 
| 133 | 
            +
                    let :config_hash do
         | 
| 134 | 
            +
                      { "backups" => {
         | 
| 135 | 
            +
                        "frequency" => 60,
         | 
| 136 | 
            +
                        "keep" => {
         | 
| 137 | 
            +
                          "hourly" => 1
         | 
| 138 | 
            +
                        }},
         | 
| 139 | 
            +
                        "production" => {
         | 
| 140 | 
            +
                          "backups" => {
         | 
| 141 | 
            +
                            "keep" => {
         | 
| 142 | 
            +
                              "hourly" => 12
         | 
| 143 | 
            +
                            }
         | 
| 144 | 
            +
                          }
         | 
| 145 | 
            +
                        },
         | 
| 146 | 
            +
                        "local" => "production"
         | 
| 147 | 
            +
                      }
         | 
| 148 | 
            +
                    end
         | 
| 149 | 
            +
             | 
| 150 | 
            +
                    it "should prefer the local config" do
         | 
| 151 | 
            +
                      expect(schedule_array).to contain_exactly([60, 12])
         | 
| 152 | 
            +
                    end
         | 
| 153 | 
            +
                  end
         | 
| 154 | 
            +
             | 
| 131 155 | 
             
                  context "mismatched frequency" do
         | 
| 132 156 | 
             
                    let :config_hash do
         | 
| 133 157 | 
             
                      { "backups" => {
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: bibliotech
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.7.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Evan Dorn
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2015- | 
| 12 | 
            +
            date: 2015-06-02 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: caliph
         | 
| @@ -130,7 +130,7 @@ rdoc_options: | |
| 130 130 | 
             
            - --main
         | 
| 131 131 | 
             
            - doc/README
         | 
| 132 132 | 
             
            - --title
         | 
| 133 | 
            -
            - bibliotech-0. | 
| 133 | 
            +
            - bibliotech-0.7.0 Documentation
         | 
| 134 134 | 
             
            require_paths:
         | 
| 135 135 | 
             
            - lib/
         | 
| 136 136 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         |