sapience 0.2.4 → 0.2.5
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/.codeclimate.yml +21 -0
- data/.simplecov +19 -16
- data/.travis.yml +3 -3
- data/CHANGELOG.md +4 -0
- data/Gemfile +0 -8
- data/README.md +5 -0
- data/config/default.yml +4 -0
- data/docker-compose.yml +14 -0
- data/lib/sapience/appender/stream.rb +0 -1
- data/lib/sapience/base.rb +34 -4
- data/lib/sapience/configuration.rb +41 -20
- data/lib/sapience/core_ext/hash.rb +10 -7
- data/lib/sapience/core_ext/symbol.rb +15 -0
- data/lib/sapience/core_ext/thread.rb +1 -0
- data/lib/sapience/extensions/action_cable/tagged_logger_proxy.rb +2 -0
- data/lib/sapience/extensions/action_controller/live.rb +2 -0
- data/lib/sapience/extensions/action_controller/log_subscriber.rb +76 -121
- data/lib/sapience/extensions/action_dispatch/debug_exceptions.rb +2 -0
- data/lib/sapience/extensions/action_view/log_subscriber.rb +16 -6
- data/lib/sapience/extensions/action_view/streaming_template_renderer.rb +2 -0
- data/lib/sapience/extensions/active_job/logging.rb +1 -1
- data/lib/sapience/extensions/active_model_serializers/logging.rb +7 -2
- data/lib/sapience/extensions/active_record/log_subscriber.rb +45 -29
- data/lib/sapience/extensions/rails/rack/logger.rb +1 -0
- data/lib/sapience/extensions/rails/rack/logger_info_as_debug.rb +2 -0
- data/lib/sapience/formatters/color.rb +0 -1
- data/lib/sapience/formatters/default.rb +0 -1
- data/lib/sapience/formatters/json.rb +0 -1
- data/lib/sapience/formatters/raw.rb +0 -1
- data/lib/sapience/log.rb +54 -35
- data/lib/sapience/logger.rb +50 -71
- data/lib/sapience/rails.rb +17 -20
- data/lib/sapience/sapience.rb +23 -27
- data/lib/sapience/subscriber.rb +1 -13
- data/lib/sapience/version.rb +1 -1
- data/lib/sapience.rb +4 -3
- data/sapience.gemspec +6 -1
- data/test_app/Gemfile +7 -0
- data/test_app/Rakefile +2 -0
- data/test_app/app/models/post.rb +1 -1
- data/test_app/app/views/posts/_form.html.slim +18 -0
- data/test_app/app/views/posts/edit.html.slim +8 -0
- data/test_app/app/views/posts/index.html.slim +25 -0
- data/test_app/app/views/posts/new.html.slim +5 -0
- data/test_app/app/views/posts/show.html.slim +15 -0
- data/test_app/app/workers/test_worker.rb +17 -0
- data/test_app/bin/sneakers +10 -0
- data/test_app/config/initializers/sneakers.rb +15 -0
- data/test_app/config/sapience_example.yml +24 -0
- data/test_app/db/migrate/{20160812093621_create_posts.rb → 20160902141445_create_posts.rb} +1 -1
- data/test_app/db/schema.rb +1 -1
- data/test_app/lib/external_sneaker.rb +46 -0
- data/test_app/spec/factories/posts.rb +7 -0
- data/test_app/spec/factories/users.rb +8 -0
- data/test_app/spec/rails_helper.rb +8 -3
- data/test_app/spec/requests/posts_spec.rb +2 -1
- data/test_app/spec/views/posts/edit.html.slim_spec.rb +17 -0
- data/test_app/spec/views/posts/index.html.slim_spec.rb +17 -0
- data/test_app/spec/views/posts/new.html.slim_spec.rb +17 -0
- data/test_app/spec/views/posts/show.html.slim_spec.rb +14 -0
- data/test_app/spec/workers/test_worker_spec.rb +36 -0
- data/test_app.simplecov +19 -0
- metadata +95 -15
- data/.coveralls.yml +0 -1
- data/lib/sapience/extensions/action_controller/log_subscriber_processing.rb +0 -24
- data/test_app/app/views/posts/_form.html.erb +0 -32
- data/test_app/app/views/posts/create.html.erb +0 -2
- data/test_app/app/views/posts/destroy.html.erb +0 -2
- data/test_app/app/views/posts/edit.html.erb +0 -6
- data/test_app/app/views/posts/index.html.erb +0 -31
- data/test_app/app/views/posts/new.html.erb +0 -5
- data/test_app/app/views/posts/show.html.erb +0 -19
- data/test_app/app/views/posts/update.html.erb +0 -2
| @@ -6,6 +6,8 @@ abort("The Rails environment is running in production mode!") if Rails.env.produ | |
| 6 6 | 
             
            require "spec_helper"
         | 
| 7 7 | 
             
            require "rspec/rails"
         | 
| 8 8 | 
             
            require "rspec/its"
         | 
| 9 | 
            +
            require "rspec/wait"
         | 
| 10 | 
            +
            require_relative "../../spec/support/file_helper"
         | 
| 9 11 |  | 
| 10 12 | 
             
            Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
         | 
| 11 13 |  | 
| @@ -14,6 +16,7 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } | |
| 14 16 | 
             
            ActiveRecord::Migration.maintain_test_schema!
         | 
| 15 17 |  | 
| 16 18 | 
             
            RSpec.configure do |config|
         | 
| 19 | 
            +
              config.include FileHelper
         | 
| 17 20 | 
             
              # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
         | 
| 18 21 | 
             
              config.fixture_path = "#{::Rails.root}/spec/fixtures"
         | 
| 19 22 |  | 
| @@ -25,14 +28,16 @@ RSpec.configure do |config| | |
| 25 28 | 
             
                Sapience.reset!
         | 
| 26 29 | 
             
              end
         | 
| 27 30 |  | 
| 28 | 
            -
              config.before(: | 
| 31 | 
            +
              config.before(:each) do
         | 
| 29 32 | 
             
                FileUtils.cp(
         | 
| 30 33 | 
             
                  Rails.root.join("spec/fixtures/sapience.yml"),
         | 
| 31 34 | 
             
                  Rails.root.join("config/sapience.yml"),
         | 
| 32 35 | 
             
                )
         | 
| 33 36 | 
             
              end
         | 
| 34 37 |  | 
| 35 | 
            -
              config.after(: | 
| 36 | 
            -
                 | 
| 38 | 
            +
              config.after(:each) do
         | 
| 39 | 
            +
                sapience_config = Rails.root.join("config/sapience.yml")
         | 
| 40 | 
            +
                FileUtils.rm(sapience_config) if File.exist?(sapience_config)
         | 
| 37 41 | 
             
              end
         | 
| 42 | 
            +
              config.include FactoryGirl::Syntax::Methods
         | 
| 38 43 | 
             
            end
         | 
| @@ -0,0 +1,17 @@ | |
| 1 | 
            +
            require "rails_helper"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            RSpec.describe "posts/edit", type: :view do
         | 
| 4 | 
            +
              let(:post) { create(:post, title: "Title", body: "Body") }
         | 
| 5 | 
            +
              before(:each) do
         | 
| 6 | 
            +
                @post = assign(:post, post)
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              it "renders the edit post form" do
         | 
| 10 | 
            +
                render
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                assert_select "form[action=?][method=?]", post_path(@post), "post" do
         | 
| 13 | 
            +
                  assert_select "input#post_title[name=?]", "post[title]"
         | 
| 14 | 
            +
                  assert_select "input#post_body[name=?]", "post[body]"
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
            end
         | 
| @@ -0,0 +1,17 @@ | |
| 1 | 
            +
            require "rails_helper"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            RSpec.describe "posts/index", type: :view do
         | 
| 4 | 
            +
              let(:posts) { [create(:post, title: "Title", body: "Body"), create(:post)] }
         | 
| 5 | 
            +
              before(:each) do
         | 
| 6 | 
            +
                assign(:posts, posts)
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              it "renders a list of posts" do
         | 
| 10 | 
            +
                render
         | 
| 11 | 
            +
                assert_select "tr>td", text: "Title", count: 1
         | 
| 12 | 
            +
                assert_select "tr>td", text: "Body", count: 1
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                assert_select "tr>td", text: "This is a post", count: 1
         | 
| 15 | 
            +
                assert_select "tr>td", text: "It has a lot of content", count: 1
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
            end
         | 
| @@ -0,0 +1,17 @@ | |
| 1 | 
            +
            require "rails_helper"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            RSpec.describe "posts/new", type: :view do
         | 
| 4 | 
            +
              let(:post) { build :post }
         | 
| 5 | 
            +
              before(:each) do
         | 
| 6 | 
            +
                assign(:post, post)
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              it "renders new post form" do
         | 
| 10 | 
            +
                render
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                assert_select "form[action=?][method=?]", posts_path, "post" do
         | 
| 13 | 
            +
                  assert_select "input#post_title[name=?]", "post[title]"
         | 
| 14 | 
            +
                  assert_select "input#post_body[name=?]", "post[body]"
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
            end
         | 
| @@ -0,0 +1,14 @@ | |
| 1 | 
            +
            require "rails_helper"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            RSpec.describe "posts/show", type: :view do
         | 
| 4 | 
            +
              let(:post) { create(:post, title: "Title", body: "Body") }
         | 
| 5 | 
            +
              before(:each) do
         | 
| 6 | 
            +
                @post = assign(:post, post)
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              it "renders attributes in <p>" do
         | 
| 10 | 
            +
                render
         | 
| 11 | 
            +
                expect(rendered).to match(/Title/)
         | 
| 12 | 
            +
                expect(rendered).to match(/Body/)
         | 
| 13 | 
            +
              end
         | 
| 14 | 
            +
            end
         | 
| @@ -0,0 +1,36 @@ | |
| 1 | 
            +
            require "rails_helper"
         | 
| 2 | 
            +
            require "serverengine"
         | 
| 3 | 
            +
            require "sneakers"
         | 
| 4 | 
            +
            require "sneakers/runner"
         | 
| 5 | 
            +
            require "external_sneaker"
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            describe TestWorker, "This is manual labor as we can't verify that sneakers is running", :skip do
         | 
| 8 | 
            +
              include FileHelper
         | 
| 9 | 
            +
              let(:message) do
         | 
| 10 | 
            +
                {
         | 
| 11 | 
            +
                  title: "Cool",
         | 
| 12 | 
            +
                  body: "Hot",
         | 
| 13 | 
            +
                }
         | 
| 14 | 
            +
              end
         | 
| 15 | 
            +
              let(:logger) { Sapience[described_class] }
         | 
| 16 | 
            +
             | 
| 17 | 
            +
              before do
         | 
| 18 | 
            +
                @sneakers_worker = ExternalSneaker.new("rake sneakers:run")
         | 
| 19 | 
            +
                @sneakers_worker.start
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                Sneakers.publish(
         | 
| 22 | 
            +
                  message.to_json,
         | 
| 23 | 
            +
                  to_queue: described_class::QUEUE_NAME,
         | 
| 24 | 
            +
                  routing_key: described_class::ROUTING_KEY,
         | 
| 25 | 
            +
                )
         | 
| 26 | 
            +
              end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              after do
         | 
| 29 | 
            +
                delete_file("config/sapience.yml")
         | 
| 30 | 
            +
                delete_file(described_class::VERIFICATION_FILE)
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
              it "runs properly" do
         | 
| 34 | 
            +
                wait(30.seconds).for { File.exist?(described_class::VERIFICATION_FILE) }.to eq(true)
         | 
| 35 | 
            +
              end
         | 
| 36 | 
            +
            end
         | 
    
        data/test_app.simplecov
    ADDED
    
    | @@ -0,0 +1,19 @@ | |
| 1 | 
            +
            require "simplecov-json"
         | 
| 2 | 
            +
            require "codeclimate-test-reporter"
         | 
| 3 | 
            +
            require "coveralls"
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            CodeClimate::TestReporter.start
         | 
| 6 | 
            +
            SimpleCov.maximum_coverage_drop 1
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            SimpleCov.formatters = [
         | 
| 9 | 
            +
              SimpleCov::Formatter::HTMLFormatter,
         | 
| 10 | 
            +
              SimpleCov::Formatter::JSONFormatter,
         | 
| 11 | 
            +
              CodeClimate::TestReporter::Formatter,
         | 
| 12 | 
            +
              Coveralls::SimpleCov::Formatter,
         | 
| 13 | 
            +
            ]
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            SimpleCov.start do
         | 
| 16 | 
            +
              add_filter "/spec/"
         | 
| 17 | 
            +
              add_filter "/bin/"
         | 
| 18 | 
            +
              add_filter "/gemfiles/"
         | 
| 19 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: sapience
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.5
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Mikael Henriksson
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2016-09- | 
| 12 | 
            +
            date: 2016-09-09 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: concurrent-ruby
         | 
| @@ -138,7 +138,35 @@ dependencies: | |
| 138 138 | 
             
                  - !ruby/object:Gem::Version
         | 
| 139 139 | 
             
                    version: '0'
         | 
| 140 140 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 141 | 
            -
              name:  | 
| 141 | 
            +
              name: pry-nav
         | 
| 142 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 143 | 
            +
                requirements:
         | 
| 144 | 
            +
                - - ">="
         | 
| 145 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 146 | 
            +
                    version: '0'
         | 
| 147 | 
            +
              type: :development
         | 
| 148 | 
            +
              prerelease: false
         | 
| 149 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 150 | 
            +
                requirements:
         | 
| 151 | 
            +
                - - ">="
         | 
| 152 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 153 | 
            +
                    version: '0'
         | 
| 154 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 155 | 
            +
              name: sentry-raven
         | 
| 156 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 157 | 
            +
                requirements:
         | 
| 158 | 
            +
                - - ">="
         | 
| 159 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 160 | 
            +
                    version: '0'
         | 
| 161 | 
            +
              type: :development
         | 
| 162 | 
            +
              prerelease: false
         | 
| 163 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 164 | 
            +
                requirements:
         | 
| 165 | 
            +
                - - ">="
         | 
| 166 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 167 | 
            +
                    version: '0'
         | 
| 168 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 169 | 
            +
              name: dogstatsd-ruby
         | 
| 142 170 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 143 171 | 
             
                requirements:
         | 
| 144 172 | 
             
                - - ">="
         | 
| @@ -152,7 +180,49 @@ dependencies: | |
| 152 180 | 
             
                  - !ruby/object:Gem::Version
         | 
| 153 181 | 
             
                    version: '0'
         | 
| 154 182 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 155 | 
            -
              name:  | 
| 183 | 
            +
              name: rails
         | 
| 184 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 185 | 
            +
                requirements:
         | 
| 186 | 
            +
                - - "~>"
         | 
| 187 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 188 | 
            +
                    version: 5.0.0.1
         | 
| 189 | 
            +
              type: :development
         | 
| 190 | 
            +
              prerelease: false
         | 
| 191 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 192 | 
            +
                requirements:
         | 
| 193 | 
            +
                - - "~>"
         | 
| 194 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 195 | 
            +
                    version: 5.0.0.1
         | 
| 196 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 197 | 
            +
              name: grape
         | 
| 198 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 199 | 
            +
                requirements:
         | 
| 200 | 
            +
                - - ">="
         | 
| 201 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 202 | 
            +
                    version: '0'
         | 
| 203 | 
            +
              type: :development
         | 
| 204 | 
            +
              prerelease: false
         | 
| 205 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 206 | 
            +
                requirements:
         | 
| 207 | 
            +
                - - ">="
         | 
| 208 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 209 | 
            +
                    version: '0'
         | 
| 210 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 211 | 
            +
              name: active_model_serializers
         | 
| 212 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 213 | 
            +
                requirements:
         | 
| 214 | 
            +
                - - "~>"
         | 
| 215 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 216 | 
            +
                    version: 0.10.0
         | 
| 217 | 
            +
              type: :development
         | 
| 218 | 
            +
              prerelease: false
         | 
| 219 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 220 | 
            +
                requirements:
         | 
| 221 | 
            +
                - - "~>"
         | 
| 222 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 223 | 
            +
                    version: 0.10.0
         | 
| 224 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 225 | 
            +
              name: codeclimate-test-reporter
         | 
| 156 226 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 157 227 | 
             
                requirements:
         | 
| 158 228 | 
             
                - - ">="
         | 
| @@ -189,7 +259,7 @@ executables: | |
| 189 259 | 
             
            extensions: []
         | 
| 190 260 | 
             
            extra_rdoc_files: []
         | 
| 191 261 | 
             
            files:
         | 
| 192 | 
            -
            - ". | 
| 262 | 
            +
            - ".codeclimate.yml"
         | 
| 193 263 | 
             
            - ".gitignore"
         | 
| 194 264 | 
             
            - ".rspec"
         | 
| 195 265 | 
             
            - ".ruby-version"
         | 
| @@ -218,12 +288,12 @@ files: | |
| 218 288 | 
             
            - lib/sapience/configuration.rb
         | 
| 219 289 | 
             
            - lib/sapience/configuration/grape.rb
         | 
| 220 290 | 
             
            - lib/sapience/core_ext/hash.rb
         | 
| 291 | 
            +
            - lib/sapience/core_ext/symbol.rb
         | 
| 221 292 | 
             
            - lib/sapience/core_ext/thread.rb
         | 
| 222 293 | 
             
            - lib/sapience/descendants.rb
         | 
| 223 294 | 
             
            - lib/sapience/extensions/action_cable/tagged_logger_proxy.rb
         | 
| 224 295 | 
             
            - lib/sapience/extensions/action_controller/live.rb
         | 
| 225 296 | 
             
            - lib/sapience/extensions/action_controller/log_subscriber.rb
         | 
| 226 | 
            -
            - lib/sapience/extensions/action_controller/log_subscriber_processing.rb
         | 
| 227 297 | 
             
            - lib/sapience/extensions/action_dispatch/debug_exceptions.rb
         | 
| 228 298 | 
             
            - lib/sapience/extensions/action_view/log_subscriber.rb
         | 
| 229 299 | 
             
            - lib/sapience/extensions/action_view/streaming_template_renderer.rb
         | 
| @@ -249,6 +319,7 @@ files: | |
| 249 319 | 
             
            - lib/sapience/subscriber.rb
         | 
| 250 320 | 
             
            - lib/sapience/version.rb
         | 
| 251 321 | 
             
            - sapience.gemspec
         | 
| 322 | 
            +
            - test_app.simplecov
         | 
| 252 323 | 
             
            - test_app/.gitignore
         | 
| 253 324 | 
             
            - test_app/.rspec
         | 
| 254 325 | 
             
            - test_app/.ruby-version
         | 
| @@ -277,18 +348,17 @@ files: | |
| 277 348 | 
             
            - test_app/app/views/layouts/application.html.erb
         | 
| 278 349 | 
             
            - test_app/app/views/layouts/mailer.html.erb
         | 
| 279 350 | 
             
            - test_app/app/views/layouts/mailer.text.erb
         | 
| 280 | 
            -
            - test_app/app/views/posts/_form.html. | 
| 281 | 
            -
            - test_app/app/views/posts/ | 
| 282 | 
            -
            - test_app/app/views/posts/ | 
| 283 | 
            -
            - test_app/app/views/posts/ | 
| 284 | 
            -
            - test_app/app/views/posts/ | 
| 285 | 
            -
            - test_app/app/ | 
| 286 | 
            -
            - test_app/app/views/posts/show.html.erb
         | 
| 287 | 
            -
            - test_app/app/views/posts/update.html.erb
         | 
| 351 | 
            +
            - test_app/app/views/posts/_form.html.slim
         | 
| 352 | 
            +
            - test_app/app/views/posts/edit.html.slim
         | 
| 353 | 
            +
            - test_app/app/views/posts/index.html.slim
         | 
| 354 | 
            +
            - test_app/app/views/posts/new.html.slim
         | 
| 355 | 
            +
            - test_app/app/views/posts/show.html.slim
         | 
| 356 | 
            +
            - test_app/app/workers/test_worker.rb
         | 
| 288 357 | 
             
            - test_app/bin/bundle
         | 
| 289 358 | 
             
            - test_app/bin/rails
         | 
| 290 359 | 
             
            - test_app/bin/rake
         | 
| 291 360 | 
             
            - test_app/bin/setup
         | 
| 361 | 
            +
            - test_app/bin/sneakers
         | 
| 292 362 | 
             
            - test_app/bin/update
         | 
| 293 363 | 
             
            - test_app/config.ru
         | 
| 294 364 | 
             
            - test_app/config/application.rb
         | 
| @@ -307,16 +377,19 @@ files: | |
| 307 377 | 
             
            - test_app/config/initializers/mime_types.rb
         | 
| 308 378 | 
             
            - test_app/config/initializers/new_framework_defaults.rb
         | 
| 309 379 | 
             
            - test_app/config/initializers/session_store.rb
         | 
| 380 | 
            +
            - test_app/config/initializers/sneakers.rb
         | 
| 310 381 | 
             
            - test_app/config/initializers/wrap_parameters.rb
         | 
| 311 382 | 
             
            - test_app/config/locales/en.yml
         | 
| 312 383 | 
             
            - test_app/config/puma.rb
         | 
| 313 384 | 
             
            - test_app/config/routes.rb
         | 
| 385 | 
            +
            - test_app/config/sapience_example.yml
         | 
| 314 386 | 
             
            - test_app/config/secrets.yml
         | 
| 315 387 | 
             
            - test_app/db/migrate/20160812092236_create_users.rb
         | 
| 316 | 
            -
            - test_app/db/migrate/ | 
| 388 | 
            +
            - test_app/db/migrate/20160902141445_create_posts.rb
         | 
| 317 389 | 
             
            - test_app/db/schema.rb
         | 
| 318 390 | 
             
            - test_app/db/seeds.rb
         | 
| 319 391 | 
             
            - test_app/lib/assets/.keep
         | 
| 392 | 
            +
            - test_app/lib/external_sneaker.rb
         | 
| 320 393 | 
             
            - test_app/lib/tasks/.keep
         | 
| 321 394 | 
             
            - test_app/log/.keep
         | 
| 322 395 | 
             
            - test_app/public/404.html
         | 
| @@ -327,6 +400,8 @@ files: | |
| 327 400 | 
             
            - test_app/public/favicon.ico
         | 
| 328 401 | 
             
            - test_app/public/robots.txt
         | 
| 329 402 | 
             
            - test_app/spec/controllers/posts_controller_spec.rb
         | 
| 403 | 
            +
            - test_app/spec/factories/posts.rb
         | 
| 404 | 
            +
            - test_app/spec/factories/users.rb
         | 
| 330 405 | 
             
            - test_app/spec/fixtures/sapience.yml
         | 
| 331 406 | 
             
            - test_app/spec/helpers/posts_helper_spec.rb
         | 
| 332 407 | 
             
            - test_app/spec/integration/sapience_spec.rb
         | 
| @@ -336,6 +411,11 @@ files: | |
| 336 411 | 
             
            - test_app/spec/requests/posts_spec.rb
         | 
| 337 412 | 
             
            - test_app/spec/routing/posts_routing_spec.rb
         | 
| 338 413 | 
             
            - test_app/spec/spec_helper.rb
         | 
| 414 | 
            +
            - test_app/spec/views/posts/edit.html.slim_spec.rb
         | 
| 415 | 
            +
            - test_app/spec/views/posts/index.html.slim_spec.rb
         | 
| 416 | 
            +
            - test_app/spec/views/posts/new.html.slim_spec.rb
         | 
| 417 | 
            +
            - test_app/spec/views/posts/show.html.slim_spec.rb
         | 
| 418 | 
            +
            - test_app/spec/workers/test_worker_spec.rb
         | 
| 339 419 | 
             
            - test_app/tmp/.keep
         | 
| 340 420 | 
             
            - test_app/vendor/assets/stylesheets/.keep
         | 
| 341 421 | 
             
            homepage: https://github.com/reevoo/sapience
         | 
    
        data/.coveralls.yml
    DELETED
    
    | @@ -1 +0,0 @@ | |
| 1 | 
            -
            repo_token: 2pF5ERW8NKVYqrkGeGTvzGP7oYLidlQ41
         | 
| @@ -1,24 +0,0 @@ | |
| 1 | 
            -
            require "action_controller/log_subscriber"
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            class ActionController::LogSubscriber # rubocop:disable ClassAndModuleChildren
         | 
| 4 | 
            -
              # Log as info to show Processing messages in production
         | 
| 5 | 
            -
              def start_processing(event)
         | 
| 6 | 
            -
                controller_logger(event).info { "Processing ##{event.payload[:action]}" }
         | 
| 7 | 
            -
              end
         | 
| 8 | 
            -
             | 
| 9 | 
            -
              private
         | 
| 10 | 
            -
             | 
| 11 | 
            -
              # Returns the logger for the supplied event.
         | 
| 12 | 
            -
              # Returns ActionController::Base.logger if no controller is present
         | 
| 13 | 
            -
              def controller_logger(event)
         | 
| 14 | 
            -
                if (controller = event.payload[:controller])
         | 
| 15 | 
            -
                  begin
         | 
| 16 | 
            -
                    controller.constantize.logger
         | 
| 17 | 
            -
                  rescue NameError
         | 
| 18 | 
            -
                    ActionController::Base.logger
         | 
| 19 | 
            -
                  end
         | 
| 20 | 
            -
                else
         | 
| 21 | 
            -
                  ActionController::Base.logger
         | 
| 22 | 
            -
                end
         | 
| 23 | 
            -
              end
         | 
| 24 | 
            -
            end
         | 
| @@ -1,32 +0,0 @@ | |
| 1 | 
            -
            <%= form_for(post) do |f| %>
         | 
| 2 | 
            -
              <% if post.errors.any? %>
         | 
| 3 | 
            -
                <div id="error_explanation">
         | 
| 4 | 
            -
                  <h2><%= pluralize(post.errors.count, "error") %> prohibited this post from being saved:</h2>
         | 
| 5 | 
            -
             | 
| 6 | 
            -
                  <ul>
         | 
| 7 | 
            -
                  <% post.errors.full_messages.each do |message| %>
         | 
| 8 | 
            -
                    <li><%= message %></li>
         | 
| 9 | 
            -
                  <% end %>
         | 
| 10 | 
            -
                  </ul>
         | 
| 11 | 
            -
                </div>
         | 
| 12 | 
            -
              <% end %>
         | 
| 13 | 
            -
             | 
| 14 | 
            -
              <div class="field">
         | 
| 15 | 
            -
                <%= f.label :title %>
         | 
| 16 | 
            -
                <%= f.text_field :title %>
         | 
| 17 | 
            -
              </div>
         | 
| 18 | 
            -
             | 
| 19 | 
            -
              <div class="field">
         | 
| 20 | 
            -
                <%= f.label :body %>
         | 
| 21 | 
            -
                <%= f.text_field :body %>
         | 
| 22 | 
            -
              </div>
         | 
| 23 | 
            -
             | 
| 24 | 
            -
              <div class="field">
         | 
| 25 | 
            -
                <%= f.label :author_id %>
         | 
| 26 | 
            -
                <%= f.text_field :author_id %>
         | 
| 27 | 
            -
              </div>
         | 
| 28 | 
            -
             | 
| 29 | 
            -
              <div class="actions">
         | 
| 30 | 
            -
                <%= f.submit %>
         | 
| 31 | 
            -
              </div>
         | 
| 32 | 
            -
            <% end %>
         | 
| @@ -1,31 +0,0 @@ | |
| 1 | 
            -
            <p id="notice"><%= notice %></p>
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            <h1>Posts</h1>
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            <table>
         | 
| 6 | 
            -
              <thead>
         | 
| 7 | 
            -
                <tr>
         | 
| 8 | 
            -
                  <th>Title</th>
         | 
| 9 | 
            -
                  <th>Body</th>
         | 
| 10 | 
            -
                  <th>Author</th>
         | 
| 11 | 
            -
                  <th colspan="3"></th>
         | 
| 12 | 
            -
                </tr>
         | 
| 13 | 
            -
              </thead>
         | 
| 14 | 
            -
             | 
| 15 | 
            -
              <tbody>
         | 
| 16 | 
            -
                <% @posts.each do |post| %>
         | 
| 17 | 
            -
                  <tr>
         | 
| 18 | 
            -
                    <td><%= post.title %></td>
         | 
| 19 | 
            -
                    <td><%= post.body %></td>
         | 
| 20 | 
            -
                    <td><%= post.author %></td>
         | 
| 21 | 
            -
                    <td><%= link_to 'Show', post %></td>
         | 
| 22 | 
            -
                    <td><%= link_to 'Edit', edit_post_path(post) %></td>
         | 
| 23 | 
            -
                    <td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %></td>
         | 
| 24 | 
            -
                  </tr>
         | 
| 25 | 
            -
                <% end %>
         | 
| 26 | 
            -
              </tbody>
         | 
| 27 | 
            -
            </table>
         | 
| 28 | 
            -
             | 
| 29 | 
            -
            <br>
         | 
| 30 | 
            -
             | 
| 31 | 
            -
            <%= link_to 'New Post', new_post_path %>
         | 
| @@ -1,19 +0,0 @@ | |
| 1 | 
            -
            <p id="notice"><%= notice %></p>
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            <p>
         | 
| 4 | 
            -
              <strong>Title:</strong>
         | 
| 5 | 
            -
              <%= @post.title %>
         | 
| 6 | 
            -
            </p>
         | 
| 7 | 
            -
             | 
| 8 | 
            -
            <p>
         | 
| 9 | 
            -
              <strong>Body:</strong>
         | 
| 10 | 
            -
              <%= @post.body %>
         | 
| 11 | 
            -
            </p>
         | 
| 12 | 
            -
             | 
| 13 | 
            -
            <p>
         | 
| 14 | 
            -
              <strong>Author:</strong>
         | 
| 15 | 
            -
              <%= @post.author %>
         | 
| 16 | 
            -
            </p>
         | 
| 17 | 
            -
             | 
| 18 | 
            -
            <%= link_to 'Edit', edit_post_path(@post) %> |
         | 
| 19 | 
            -
            <%= link_to 'Back', posts_path %>
         |