heroku_config_vars 0.0.2.pre → 1.0.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.
- data/README.md +71 -1
- data/app/controllers/heroku_config_vars/application_controller.rb +31 -25
- data/app/views/layouts/heroku_config_vars/application.html.erb +2 -2
- data/lib/heroku_config_vars/version.rb +1 -1
- data/lib/heroku_config_vars.rb +2 -0
- data/spec/dummy/app/controllers/application_controller.rb +13 -3
- data/spec/dummy/config/initializers/heroku_config_vars.rb +1 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/log/test.log +7052 -0
- data/spec/dummy/tmp/capybara/capybara-201303191317084976807424.html +26 -0
- data/spec/dummy/tmp/pids/server.pid +1 -1
- data/spec/features/config_vars/edit_spec.rb +7 -7
- data/spec/features/config_vars/show_spec.rb +2 -2
- data/spec/features/env/show_spec.rb +1 -1
- data/spec/features/security/requires_admin_spec.rb +3 -1
- data/spec/features/security/suggests_ssl_spec.rb +5 -5
- data/spec/features/setup/new_app_spec.rb +6 -6
- data/spec/spec_helper.rb +0 -1
- metadata +17 -10
| @@ -0,0 +1,26 @@ | |
| 1 | 
            +
            <!DOCTYPE html>
         | 
| 2 | 
            +
            <html>
         | 
| 3 | 
            +
            <head>
         | 
| 4 | 
            +
              <title>HerokuConfigVars</title>
         | 
| 5 | 
            +
              <link href="/assets/heroku_config_vars/application.css" media="all" rel="stylesheet" type="text/css" />
         | 
| 6 | 
            +
              <script src="/assets/heroku_config_vars/application.js" type="text/javascript"></script>
         | 
| 7 | 
            +
              
         | 
| 8 | 
            +
            </head>
         | 
| 9 | 
            +
            <body>
         | 
| 10 | 
            +
              <h1>Heroku Configurator</h1>
         | 
| 11 | 
            +
             | 
| 12 | 
            +
              <ul class="submenu">
         | 
| 13 | 
            +
                <li><a href="/heroku_config_vars/heroku_app"><span class="menu-option">Heroku Configuration Variables</span></a></li>
         | 
| 14 | 
            +
                <li><a href="/heroku_config_vars/env"><span class="menu-option">Native Environment</span></a></li>
         | 
| 15 | 
            +
              </ul>
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            <h2>WARNING</h2>
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            <p>You are trying to view sensitive application configuration over an <strong>insecure connection</strong>.</p>
         | 
| 20 | 
            +
            <p>It is highly recommended that you view this over https.</p>
         | 
| 21 | 
            +
            <a href="https://www.example.com/heroku_config_vars/heroku_app" class="happy button">Switch to secure connection</a>
         | 
| 22 | 
            +
            <a href="/heroku_config_vars/heroku_app?insecure=ok" class="sad button">Continue insecurely</a>
         | 
| 23 | 
            +
             | 
| 24 | 
            +
             | 
| 25 | 
            +
            </body>
         | 
| 26 | 
            +
            </html>
         | 
| @@ -1 +1 @@ | |
| 1 | 
            -
             | 
| 1 | 
            +
            42902
         | 
| @@ -16,10 +16,10 @@ feature 'Edit Herkou configuration' do | |
| 16 16 |  | 
| 17 17 | 
             
              # TODO: move most of this into a view spec
         | 
| 18 18 | 
             
              scenario 'Vist the edit page' do
         | 
| 19 | 
            -
                visit edit_heroku_app_url(protocol: 'https')
         | 
| 19 | 
            +
                visit heroku_config_vars.edit_heroku_app_url(protocol: 'https')
         | 
| 20 20 |  | 
| 21 21 | 
             
                within 'h2' do
         | 
| 22 | 
            -
                  expect(page).to have_link valid_app_name, href: heroku_app_path
         | 
| 22 | 
            +
                  expect(page).to have_link valid_app_name, href: heroku_config_vars.heroku_app_path
         | 
| 23 23 | 
             
                  expect(page).to have_text "Edit Configuration"
         | 
| 24 24 | 
             
                end
         | 
| 25 25 |  | 
| @@ -37,7 +37,7 @@ feature 'Edit Herkou configuration' do | |
| 37 37 | 
             
                end
         | 
| 38 38 |  | 
| 39 39 | 
             
                expect(page).to have_button 'Prepare...'
         | 
| 40 | 
            -
                expect(page).to have_link 'Cancel', href: heroku_app_path
         | 
| 40 | 
            +
                expect(page).to have_link 'Cancel', href: heroku_config_vars.heroku_app_path
         | 
| 41 41 | 
             
              end
         | 
| 42 42 |  | 
| 43 43 | 
             
            ## ----
         | 
| @@ -52,7 +52,7 @@ feature 'Edit Herkou configuration' do | |
| 52 52 | 
             
              let(:delete_var) { 'VAR1' }
         | 
| 53 53 |  | 
| 54 54 | 
             
              def visit_form
         | 
| 55 | 
            -
                visit heroku_app_url(protocol: 'https')
         | 
| 55 | 
            +
                visit heroku_config_vars.heroku_app_url(protocol: 'https')
         | 
| 56 56 | 
             
                click_link 'Edit'
         | 
| 57 57 | 
             
              end
         | 
| 58 58 |  | 
| @@ -80,7 +80,7 @@ feature 'Edit Herkou configuration' do | |
| 80 80 | 
             
                visit_form
         | 
| 81 81 | 
             
                cancel
         | 
| 82 82 |  | 
| 83 | 
            -
                expect(current_path).to eq heroku_app_path
         | 
| 83 | 
            +
                expect(current_path).to eq heroku_config_vars.heroku_app_path
         | 
| 84 84 | 
             
              end
         | 
| 85 85 |  | 
| 86 86 | 
             
              scenario 'Update vars and confirm' do
         | 
| @@ -88,7 +88,7 @@ feature 'Edit Herkou configuration' do | |
| 88 88 | 
             
                fill_out_form
         | 
| 89 89 | 
             
                confirm
         | 
| 90 90 |  | 
| 91 | 
            -
                expect(current_path).to eq edit_heroku_app_path
         | 
| 91 | 
            +
                expect(current_path).to eq heroku_config_vars.edit_heroku_app_path
         | 
| 92 92 | 
             
              end
         | 
| 93 93 |  | 
| 94 94 | 
             
              scenario 'Update vars and cancel' do
         | 
| @@ -96,7 +96,7 @@ feature 'Edit Herkou configuration' do | |
| 96 96 | 
             
                fill_out_form
         | 
| 97 97 | 
             
                cancel
         | 
| 98 98 |  | 
| 99 | 
            -
                expect(current_path).to eq edit_heroku_app_path
         | 
| 99 | 
            +
                expect(current_path).to eq heroku_config_vars.edit_heroku_app_path
         | 
| 100 100 | 
             
              end
         | 
| 101 101 |  | 
| 102 102 | 
             
            end
         | 
| @@ -15,7 +15,7 @@ feature "Show heroku config vars" do | |
| 15 15 | 
             
              end
         | 
| 16 16 |  | 
| 17 17 | 
             
              scenario "Visit vars path" do
         | 
| 18 | 
            -
                visit heroku_app_url(protocol: 'https')
         | 
| 18 | 
            +
                visit heroku_config_vars.heroku_app_url(protocol: 'https')
         | 
| 19 19 |  | 
| 20 20 | 
             
                expect(page).to have_selector 'h2', text: valid_app_name
         | 
| 21 21 |  | 
| @@ -31,7 +31,7 @@ feature "Show heroku config vars" do | |
| 31 31 | 
             
                expect(page).to have_selector 'tr:nth(4) th', text: 'VAR4'
         | 
| 32 32 | 
             
                expect(page).to have_selector 'tr:nth(4) td', text: 'value 4'
         | 
| 33 33 |  | 
| 34 | 
            -
                expect(page).to have_link 'Edit', href: edit_heroku_app_path
         | 
| 34 | 
            +
                expect(page).to have_link 'Edit', href: heroku_config_vars.edit_heroku_app_path
         | 
| 35 35 |  | 
| 36 36 | 
             
                # check for menu
         | 
| 37 37 | 
             
                expect(page).to have_selector 'li', text: 'Heroku Configuration Variables'
         | 
| @@ -3,7 +3,9 @@ require 'spec_helper' | |
| 3 3 | 
             
            feature "Requires admin" do
         | 
| 4 4 |  | 
| 5 5 | 
             
              scenario 'non-admin user visits' do
         | 
| 6 | 
            -
                expect { | 
| 6 | 
            +
                expect {
         | 
| 7 | 
            +
                  visit heroku_config_vars.root_url protocol: 'https', admin: false
         | 
| 8 | 
            +
                }.to raise_error ActionController::RoutingError
         | 
| 7 9 | 
             
              end
         | 
| 8 10 |  | 
| 9 11 | 
             
            end
         | 
| @@ -3,22 +3,22 @@ require 'spec_helper' | |
| 3 3 | 
             
            feature "Suggests SSL" do
         | 
| 4 4 |  | 
| 5 5 | 
             
              scenario "Switch to secure connection" do
         | 
| 6 | 
            -
                visit root_path protocol: 'http'
         | 
| 6 | 
            +
                visit heroku_config_vars.root_path protocol: 'http'
         | 
| 7 7 | 
             
                click_link 'Switch to secure connection'
         | 
| 8 8 |  | 
| 9 9 | 
             
                expect(current_url).to start_with 'https'
         | 
| 10 | 
            -
                expect(current_path).to start_with root_path
         | 
| 10 | 
            +
                expect(current_path).to start_with heroku_config_vars.root_path
         | 
| 11 11 | 
             
              end
         | 
| 12 12 |  | 
| 13 13 | 
             
              scenario 'Remain insecure' do
         | 
| 14 | 
            -
                visit root_path protocol: 'http'
         | 
| 14 | 
            +
                visit heroku_config_vars.root_path protocol: 'http'
         | 
| 15 15 | 
             
                click_link 'Continue insecurely'
         | 
| 16 16 |  | 
| 17 17 | 
             
                expect(current_url).to start_with 'http'
         | 
| 18 | 
            -
                expect(current_path).to start_with root_path
         | 
| 18 | 
            +
                expect(current_path).to start_with heroku_config_vars.root_path
         | 
| 19 19 |  | 
| 20 20 | 
             
                # Make sure our insecure choice is remembered
         | 
| 21 | 
            -
                visit root_path protocol: 'http'
         | 
| 21 | 
            +
                visit heroku_config_vars.root_path protocol: 'http'
         | 
| 22 22 |  | 
| 23 23 | 
             
                expect(current_url).to start_with 'http'
         | 
| 24 24 | 
             
                expect(page).not_to have_link 'Continue insecurely'
         | 
| @@ -7,13 +7,13 @@ feature 'New app' do | |
| 7 7 | 
             
              let(:set_vars) { live_vars }
         | 
| 8 8 |  | 
| 9 9 | 
             
              scenario 'Visit root without ENV set' do
         | 
| 10 | 
            -
                visit root_url(protocol: 'https')
         | 
| 10 | 
            +
                visit heroku_config_vars.root_url(protocol: 'https')
         | 
| 11 11 |  | 
| 12 | 
            -
                expect(current_path).to eq new_heroku_app_path
         | 
| 12 | 
            +
                expect(current_path).to eq heroku_config_vars.new_heroku_app_path
         | 
| 13 13 | 
             
              end
         | 
| 14 14 |  | 
| 15 15 | 
             
              scenario 'Visit new heroku app path' do
         | 
| 16 | 
            -
                visit new_heroku_app_url(protocol: 'https')
         | 
| 16 | 
            +
                visit heroku_config_vars.new_heroku_app_url(protocol: 'https')
         | 
| 17 17 |  | 
| 18 18 | 
             
                expect(page).to have_selector 'h2', text: 'One Time Setup'
         | 
| 19 19 | 
             
                expect(page).to have_field 'App Name'
         | 
| @@ -21,7 +21,7 @@ feature 'New app' do | |
| 21 21 | 
             
              end
         | 
| 22 22 |  | 
| 23 23 | 
             
              scenario 'Submit blank form' do
         | 
| 24 | 
            -
                visit new_heroku_app_url(protocol: 'https')
         | 
| 24 | 
            +
                visit heroku_config_vars.new_heroku_app_url(protocol: 'https')
         | 
| 25 25 | 
             
                click_button 'Save'
         | 
| 26 26 |  | 
| 27 27 | 
             
                expect(page).to have_selector 'li', text: "App name can't be blank"
         | 
| @@ -29,14 +29,14 @@ feature 'New app' do | |
| 29 29 | 
             
              end
         | 
| 30 30 |  | 
| 31 31 | 
             
              scenario 'Submit valid form' do
         | 
| 32 | 
            -
                visit new_heroku_app_url(protocol: 'https')
         | 
| 32 | 
            +
                visit heroku_config_vars.new_heroku_app_url(protocol: 'https')
         | 
| 33 33 | 
             
                fill_in 'App Name', with: valid_app_name
         | 
| 34 34 | 
             
                fill_in 'API Key', with: valid_api_key
         | 
| 35 35 | 
             
                click_button 'Save'
         | 
| 36 36 |  | 
| 37 37 | 
             
                expect(page).to have_selector 'h2', text: valid_app_name
         | 
| 38 38 | 
             
                expect(page).to have_text valid_api_key
         | 
| 39 | 
            -
                expect(current_path).to eq heroku_app_path
         | 
| 39 | 
            +
                expect(current_path).to eq heroku_config_vars.heroku_app_path
         | 
| 40 40 | 
             
              end
         | 
| 41 41 |  | 
| 42 42 | 
             
            end
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: heroku_config_vars
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              prerelease:  | 
| 5 | 
            -
              version: 0.0 | 
| 4 | 
            +
              prerelease: 
         | 
| 5 | 
            +
              version: 1.0.0
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| 8 8 | 
             
            - Daniel Fone
         | 
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2013- | 
| 12 | 
            +
            date: 2013-03-21 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| @@ -64,7 +64,7 @@ dependencies: | |
| 64 64 | 
             
                requirements:
         | 
| 65 65 | 
             
                - - ~>
         | 
| 66 66 | 
             
                  - !ruby/object:Gem::Version
         | 
| 67 | 
            -
                    version: 2. | 
| 67 | 
            +
                    version: 2.13.0
         | 
| 68 68 | 
             
                none: false
         | 
| 69 69 | 
             
              prerelease: false
         | 
| 70 70 | 
             
              name: rspec-rails
         | 
| @@ -72,7 +72,7 @@ dependencies: | |
| 72 72 | 
             
                requirements:
         | 
| 73 73 | 
             
                - - ~>
         | 
| 74 74 | 
             
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            -
                    version: 2. | 
| 75 | 
            +
                    version: 2.13.0
         | 
| 76 76 | 
             
                none: false
         | 
| 77 77 | 
             
              type: :development
         | 
| 78 78 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -80,7 +80,7 @@ dependencies: | |
| 80 80 | 
             
                requirements:
         | 
| 81 81 | 
             
                - - ~>
         | 
| 82 82 | 
             
                  - !ruby/object:Gem::Version
         | 
| 83 | 
            -
                    version: 1. | 
| 83 | 
            +
                    version: 1.10.0
         | 
| 84 84 | 
             
                none: false
         | 
| 85 85 | 
             
              prerelease: false
         | 
| 86 86 | 
             
              name: webmock
         | 
| @@ -88,7 +88,7 @@ dependencies: | |
| 88 88 | 
             
                requirements:
         | 
| 89 89 | 
             
                - - ~>
         | 
| 90 90 | 
             
                  - !ruby/object:Gem::Version
         | 
| 91 | 
            -
                    version: 1. | 
| 91 | 
            +
                    version: 1.10.0
         | 
| 92 92 | 
             
                none: false
         | 
| 93 93 | 
             
              type: :development
         | 
| 94 94 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -183,6 +183,7 @@ files: | |
| 183 183 | 
             
            - spec/dummy/config/environments/development.rb
         | 
| 184 184 | 
             
            - spec/dummy/config/environments/test.rb
         | 
| 185 185 | 
             
            - spec/dummy/config/initializers/backtrace_silencers.rb
         | 
| 186 | 
            +
            - spec/dummy/config/initializers/heroku_config_vars.rb
         | 
| 186 187 | 
             
            - spec/dummy/config/initializers/inflections.rb
         | 
| 187 188 | 
             
            - spec/dummy/config/initializers/mime_types.rb
         | 
| 188 189 | 
             
            - spec/dummy/config/initializers/secret_token.rb
         | 
| @@ -226,6 +227,7 @@ files: | |
| 226 227 | 
             
            - spec/dummy/tmp/capybara/capybara-201302162256278576954261.html
         | 
| 227 228 | 
             
            - spec/dummy/tmp/capybara/capybara-201302200948319507521481.html
         | 
| 228 229 | 
             
            - spec/dummy/tmp/capybara/capybara-20130220094839395273181.html
         | 
| 230 | 
            +
            - spec/dummy/tmp/capybara/capybara-201303191317084976807424.html
         | 
| 229 231 | 
             
            - spec/dummy/tmp/pids/server.pid
         | 
| 230 232 | 
             
            - spec/features/config_vars/edit_spec.rb
         | 
| 231 233 | 
             
            - spec/features/config_vars/show_spec.rb
         | 
| @@ -252,13 +254,16 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 252 254 | 
             
                  version: '0'
         | 
| 253 255 | 
             
                  segments:
         | 
| 254 256 | 
             
                  - 0
         | 
| 255 | 
            -
                  hash: - | 
| 257 | 
            +
                  hash: -2593372368354442140
         | 
| 256 258 | 
             
              none: false
         | 
| 257 259 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 258 260 | 
             
              requirements:
         | 
| 259 | 
            -
              - - ! ' | 
| 261 | 
            +
              - - ! '>='
         | 
| 260 262 | 
             
                - !ruby/object:Gem::Version
         | 
| 261 | 
            -
                  version:  | 
| 263 | 
            +
                  version: '0'
         | 
| 264 | 
            +
                  segments:
         | 
| 265 | 
            +
                  - 0
         | 
| 266 | 
            +
                  hash: -2593372368354442140
         | 
| 262 267 | 
             
              none: false
         | 
| 263 268 | 
             
            requirements: []
         | 
| 264 269 | 
             
            rubyforge_project: 
         | 
| @@ -278,6 +283,7 @@ test_files: | |
| 278 283 | 
             
            - spec/dummy/config/environments/development.rb
         | 
| 279 284 | 
             
            - spec/dummy/config/environments/test.rb
         | 
| 280 285 | 
             
            - spec/dummy/config/initializers/backtrace_silencers.rb
         | 
| 286 | 
            +
            - spec/dummy/config/initializers/heroku_config_vars.rb
         | 
| 281 287 | 
             
            - spec/dummy/config/initializers/inflections.rb
         | 
| 282 288 | 
             
            - spec/dummy/config/initializers/mime_types.rb
         | 
| 283 289 | 
             
            - spec/dummy/config/initializers/secret_token.rb
         | 
| @@ -321,6 +327,7 @@ test_files: | |
| 321 327 | 
             
            - spec/dummy/tmp/capybara/capybara-201302162256278576954261.html
         | 
| 322 328 | 
             
            - spec/dummy/tmp/capybara/capybara-201302200948319507521481.html
         | 
| 323 329 | 
             
            - spec/dummy/tmp/capybara/capybara-20130220094839395273181.html
         | 
| 330 | 
            +
            - spec/dummy/tmp/capybara/capybara-201303191317084976807424.html
         | 
| 324 331 | 
             
            - spec/dummy/tmp/pids/server.pid
         | 
| 325 332 | 
             
            - spec/features/config_vars/edit_spec.rb
         | 
| 326 333 | 
             
            - spec/features/config_vars/show_spec.rb
         |