diff --git a/index.html b/index.html index b7b04ff..9058e0e 100644 --- a/index.html +++ b/index.html @@ -53,6 +53,8 @@

mobylette
  • v 0.0.2
  • +

    Project's metric_fu

    +

    Authors

    diff --git a/v1.1.0/metric_fu/_data/20110903.yml b/metric_fu/_data/20110903.yml similarity index 100% rename from v1.1.0/metric_fu/_data/20110903.yml rename to metric_fu/_data/20110903.yml diff --git a/v1.1.0/metric_fu/_data/20110904.yml b/metric_fu/_data/20110904.yml similarity index 100% rename from v1.1.0/metric_fu/_data/20110904.yml rename to metric_fu/_data/20110904.yml diff --git a/v1.0.0/metric_fu/output/bluff-min.js b/metric_fu/output/bluff-min.js similarity index 100% rename from v1.0.0/metric_fu/output/bluff-min.js rename to metric_fu/output/bluff-min.js diff --git a/v1.1.0/metric_fu/output/churn.html b/metric_fu/output/churn.html similarity index 100% rename from v1.1.0/metric_fu/output/churn.html rename to metric_fu/output/churn.html diff --git a/v1.0.0/metric_fu/output/excanvas.js b/metric_fu/output/excanvas.js similarity index 100% rename from v1.0.0/metric_fu/output/excanvas.js rename to metric_fu/output/excanvas.js diff --git a/v1.1.0/metric_fu/output/flay.html b/metric_fu/output/flay.html similarity index 100% rename from v1.1.0/metric_fu/output/flay.html rename to metric_fu/output/flay.html diff --git a/v1.1.0/metric_fu/output/flay.js b/metric_fu/output/flay.js similarity index 100% rename from v1.1.0/metric_fu/output/flay.js rename to metric_fu/output/flay.js diff --git a/v1.1.0/metric_fu/output/flog.html b/metric_fu/output/flog.html similarity index 100% rename from v1.1.0/metric_fu/output/flog.html rename to metric_fu/output/flog.html diff --git a/v1.1.0/metric_fu/output/flog.js b/metric_fu/output/flog.js similarity index 100% rename from v1.1.0/metric_fu/output/flog.js rename to metric_fu/output/flog.js diff --git a/v1.1.0/metric_fu/output/hotspots.html b/metric_fu/output/hotspots.html similarity index 100% rename from v1.1.0/metric_fu/output/hotspots.html rename to metric_fu/output/hotspots.html diff --git a/v1.1.0/metric_fu/output/index.html b/metric_fu/output/index.html similarity index 100% rename from v1.1.0/metric_fu/output/index.html rename to metric_fu/output/index.html diff --git a/v1.0.0/metric_fu/output/js-class.js b/metric_fu/output/js-class.js similarity index 100% rename from v1.0.0/metric_fu/output/js-class.js rename to metric_fu/output/js-class.js diff --git a/v1.1.0/metric_fu/output/lib_mobylette.rb.html b/metric_fu/output/lib_mobylette.rb.html similarity index 100% rename from v1.1.0/metric_fu/output/lib_mobylette.rb.html rename to metric_fu/output/lib_mobylette.rb.html diff --git a/v1.1.0/metric_fu/output/lib_mobylette_controllers_helpers.rb.html b/metric_fu/output/lib_mobylette_controllers_helpers.rb.html similarity index 100% rename from v1.1.0/metric_fu/output/lib_mobylette_controllers_helpers.rb.html rename to metric_fu/output/lib_mobylette_controllers_helpers.rb.html diff --git a/v1.1.0/metric_fu/output/lib_mobylette_controllers_respond_to_mobile_requests.rb.html b/metric_fu/output/lib_mobylette_controllers_respond_to_mobile_requests.rb.html similarity index 100% rename from v1.1.0/metric_fu/output/lib_mobylette_controllers_respond_to_mobile_requests.rb.html rename to metric_fu/output/lib_mobylette_controllers_respond_to_mobile_requests.rb.html diff --git a/v1.1.0/metric_fu/output/lib_mobylette_helmet.rb.html b/metric_fu/output/lib_mobylette_helmet.rb.html similarity index 100% rename from v1.1.0/metric_fu/output/lib_mobylette_helmet.rb.html rename to metric_fu/output/lib_mobylette_helmet.rb.html diff --git a/v1.0.0/metric_fu/output/lib_mobylette_helmet_faker.rb.html b/metric_fu/output/lib_mobylette_helmet_faker.rb.html similarity index 100% rename from v1.0.0/metric_fu/output/lib_mobylette_helmet_faker.rb.html rename to metric_fu/output/lib_mobylette_helmet_faker.rb.html diff --git a/v1.0.0/metric_fu/output/lib_mobylette_helmet_helpers.rb.html b/metric_fu/output/lib_mobylette_helmet_helpers.rb.html similarity index 100% rename from v1.0.0/metric_fu/output/lib_mobylette_helmet_helpers.rb.html rename to metric_fu/output/lib_mobylette_helmet_helpers.rb.html diff --git a/v1.0.0/metric_fu/output/lib_mobylette_railtie.rb.html b/metric_fu/output/lib_mobylette_railtie.rb.html similarity index 100% rename from v1.0.0/metric_fu/output/lib_mobylette_railtie.rb.html rename to metric_fu/output/lib_mobylette_railtie.rb.html diff --git a/v1.1.0/metric_fu/output/lib_mobylette_version.rb.html b/metric_fu/output/lib_mobylette_version.rb.html similarity index 100% rename from v1.1.0/metric_fu/output/lib_mobylette_version.rb.html rename to metric_fu/output/lib_mobylette_version.rb.html diff --git a/v1.0.0/metric_fu/output/rails_best_practices.js b/metric_fu/output/rails_best_practices.js similarity index 100% rename from v1.0.0/metric_fu/output/rails_best_practices.js rename to metric_fu/output/rails_best_practices.js diff --git a/v1.1.0/metric_fu/output/rcov.html b/metric_fu/output/rcov.html similarity index 100% rename from v1.1.0/metric_fu/output/rcov.html rename to metric_fu/output/rcov.html diff --git a/v1.1.0/metric_fu/output/rcov.js b/metric_fu/output/rcov.js similarity index 100% rename from v1.1.0/metric_fu/output/rcov.js rename to metric_fu/output/rcov.js diff --git a/v1.1.0/metric_fu/output/reek.html b/metric_fu/output/reek.html similarity index 100% rename from v1.1.0/metric_fu/output/reek.html rename to metric_fu/output/reek.html diff --git a/v1.1.0/metric_fu/output/reek.js b/metric_fu/output/reek.js similarity index 100% rename from v1.1.0/metric_fu/output/reek.js rename to metric_fu/output/reek.js diff --git a/v1.1.0/metric_fu/output/roodi.html b/metric_fu/output/roodi.html similarity index 100% rename from v1.1.0/metric_fu/output/roodi.html rename to metric_fu/output/roodi.html diff --git a/v1.1.0/metric_fu/output/roodi.js b/metric_fu/output/roodi.js similarity index 100% rename from v1.1.0/metric_fu/output/roodi.js rename to metric_fu/output/roodi.js diff --git a/v1.1.0/metric_fu/report.yml b/metric_fu/report.yml similarity index 100% rename from v1.1.0/metric_fu/report.yml rename to metric_fu/report.yml diff --git a/v1.1.0/metric_fu/scratch/rcov/rcov.txt b/metric_fu/scratch/rcov/rcov.txt similarity index 100% rename from v1.1.0/metric_fu/scratch/rcov/rcov.txt rename to metric_fu/scratch/rcov/rcov.txt diff --git a/v1.0.0/index.html b/v1.0.0/index.html index ebf8379..238a288 100644 --- a/v1.0.0/index.html +++ b/v1.0.0/index.html @@ -22,7 +22,6 @@

    Mobylette

    This is the API documentation for 'Mobylette'.

    -

    metric_fu

    Files

    diff --git a/v1.0.0/metric_fu/_data/20110904.yml b/v1.0.0/metric_fu/_data/20110904.yml deleted file mode 100644 index 3d578be..0000000 --- a/v1.0.0/metric_fu/_data/20110904.yml +++ /dev/null @@ -1,1540 +0,0 @@ ---- -:churn: - :changes: - - :file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - :times_changed: 16 - - :file_path: README.rdoc - :times_changed: 16 - - :file_path: Gemfile.lock - :times_changed: 12 - - :file_path: Gemfile - :times_changed: 11 - - :file_path: spec/spec_helper.rb - :times_changed: 10 - - :file_path: lib/mobylette/controllers/helpers.rb - :times_changed: 10 - - :file_path: spec/controllers/home_controller_spec.rb - :times_changed: 8 - - :file_path: spec/dummy/config/routes.rb - :times_changed: 8 - - :file_path: lib/mobylette.rb - :times_changed: 8 - - :file_path: lib/mobylette/engine.rb - :times_changed: 5 - - :file_path: lib/mobylette/helmet.rb - :times_changed: 5 - - :file_path: .gitignore - :times_changed: 4 - - :file_path: spec/controllers/application_controller_spec.rb - :times_changed: 4 - - :file_path: TODO.rdoc - :times_changed: 4 - - :file_path: spec/dummy/app/controllers/home_controller.rb - :times_changed: 4 - - :file_path: CHANGELOG.rdoc - :times_changed: 3 - - :file_path: lib/mobylette/version.rb - :times_changed: 3 - - :file_path: spec/controllers/desktop_only_controller_spec.rb - :times_changed: 3 - - :file_path: spec/dummy/app/controllers/application_controller.rb - :times_changed: 3 - - :file_path: spec/controllers/actioncontroller_base_spec.rb - :times_changed: 3 - - :file_path: config/initializers/mobile_mime_types.rb - :times_changed: 3 - - :file_path: mobylette.gemspec - :times_changed: 3 - - :file_path: lib/mobylette/railtie.rb - :times_changed: 3 - - :file_path: lib/mobylette/helmet/helpers.rb - :times_changed: 3 - - :file_path: spec/helpers/mobylette_helpers_spec.rb - :times_changed: 3 - - :file_path: spec/dummy/app/views/layouts/application.html.erb - :times_changed: 3 - - :file_path: spec/dummy/app/views/layouts/application.mobile.erb - :times_changed: 3 - - :file_path: spec/dummy/app/views/home/index.html.erb - :times_changed: 3 - :class_churn: [] - :method_churn: [] - :changed_files: - - Gemfile - - Gemfile.lock - - Rakefile - :changed_classes: [] - :changed_methods: [] -:flog: - :total: 148.0925330349174 - :average: 6.170522209788225 - :method_containers: - - :name: Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb - :total_score: 26.494046915888696 - :highest_score: 25.194046915888695 - :average_score: 13.247023457944348 - :methods: - Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#none: - :operators: - :private: 1.3000000000000005 - :score: 1.3000000000000005 - :path: !!null - Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#handle_mobile: - :operators: - :branch: 7.300000000000004 - :is_mobile_request?: 1.4000000000000006 - :assignment: 3.200000000000002 - :request: 5.700000000000003 - :format: 1.800000000000001 - :to_sym: 1.600000000000001 - :fall_back_format: 6.3000000000000025 - :==: 1.600000000000001 - :formats: 1.900000000000001 - :new: 1.900000000000001 - :<<: 1.700000000000001 - :score: 25.194046915888695 - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb:76 - - :name: Mobylette::Controllers::RespondToMobileRequests::InstanceMethods - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb - :total_score: 20.604144632694826 - :highest_score: 19.304144632694825 - :average_score: 10.302072316347413 - :methods: - Mobylette::Controllers::RespondToMobileRequests::InstanceMethods#none: - :operators: - :private: 1.3000000000000005 - :score: 1.3000000000000005 - :path: !!null - Mobylette::Controllers::RespondToMobileRequests::InstanceMethods#is_mobile_request?: - :operators: - :branch: 2.800000000000001 - :request: 4.100000000000001 - :format: 1.9000000000000006 - :to_s: 3.300000000000001 - :==: 3.0000000000000013 - :params: 1.9000000000000006 - :[]: 1.7000000000000006 - :user_agent: 1.8000000000000005 - :downcase: 1.4000000000000006 - :score: 19.304144632694825 - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb:52 - - :name: Mobylette::Controllers::RespondToMobileRequests - :path: '' - :total_score: 14.051334456200241 - :highest_score: 14.051334456200241 - :average_score: 14.051334456200241 - :methods: - Mobylette::Controllers::RespondToMobileRequests#none: - :operators: - :extend: 2.4000000000000004 - :branch: 1.2000000000000002 - :included: 1.2000000000000002 - :helper_method: 1.4000000000000004 - :+: 9.000000000000004 - :score: 14.051334456200241 - :path: !!null - - :name: Mobylette::Controllers::Helpers - :path: lib/mobylette/controllers/helpers.rb - :total_score: 28.052336776102663 - :highest_score: 9.847334664770973 - :average_score: 7.013084194025666 - :methods: - Mobylette::Controllers::Helpers#none: - :operators: - :extend: 2.2 - :private: 1.1 - :score: 3.3000000000000003 - :path: !!null - Mobylette::Controllers::Helpers#mobylette_stylesheet_link_tag: - :operators: - :assignment: 1.2000000000000002 - :extract_options!: 1.2000000000000002 - :branch: 1.2000000000000002 - :is_mobile_request?: 1.2000000000000002 - :sulfix_mobile_assets: 1.7000000000000002 - :insert: 3.0000000000000004 - :stylesheet_link_tag: 2.6000000000000005 - :score: 9.847334664770973 - :path: lib/mobylette/controllers/helpers.rb:16 - Mobylette::Controllers::Helpers#mobylette_javascript_include_tag: - :operators: - :assignment: 1.2000000000000002 - :extract_options!: 1.2000000000000002 - :branch: 1.2000000000000002 - :is_mobile_request?: 1.2000000000000002 - :sulfix_mobile_assets: 1.7000000000000002 - :insert: 3.0000000000000004 - :javascript_include_tag: 2.6000000000000005 - :score: 9.847334664770973 - :path: lib/mobylette/controllers/helpers.rb:26 - Mobylette::Controllers::Helpers#sulfix_mobile_assets: - :operators: - :branch: 2.5000000000000004 - :map: 1.2000000000000002 - :assignment: 1.3000000000000003 - :split: 1.6000000000000003 - :[]: 1.4000000000000004 - :score: 5.057667446560718 - :path: lib/mobylette/controllers/helpers.rb:40 - - :name: Mobylette::Controllers::RespondToMobileRequests::ClassMethods - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb - :total_score: 9.743715923609436 - :highest_score: 9.743715923609436 - :average_score: 9.743715923609436 - :methods: - Mobylette::Controllers::RespondToMobileRequests::ClassMethods#respond_to_mobile_requests: - :operators: - :assignment: 2.600000000000001 - :branch: 1.3000000000000005 - :included_modules: 1.5000000000000004 - :include?: 1.3000000000000005 - :cattr_accessor: 1.3000000000000005 - :[]: 1.3000000000000005 - :send: 3.9000000000000012 - :score: 9.743715923609436 - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb:37 - - :name: Mobylette::Railtie::initializer - :path: lib/mobylette/railtie.rb - :total_score: 6.873136110975837 - :highest_score: 6.873136110975837 - :average_score: 6.873136110975837 - :methods: - Mobylette::Railtie::initializer#mobylette: - :operators: - :initializer: 1.0000000000000004 - :branch: 1.0000000000000004 - :on_load: 1.0000000000000004 - :send: 3.600000000000002 - :helper: 1.2000000000000006 - :score: 6.873136110975837 - :path: lib/mobylette/railtie.rb:8 - - :name: Mobylette::Helmet::Helpers - :path: lib/mobylette/helmet/helpers.rb - :total_score: 15.416187140586324 - :highest_score: 6.31506136153878 - :average_score: 3.854046785146581 - :methods: - Mobylette::Helmet::Helpers#none: - :operators: - :extend: 2.200000000000001 - :branch: 1.1000000000000005 - :included: 1.1000000000000005 - :cattr_accessor: 1.2000000000000006 - :private: 1.1000000000000005 - :score: 5.707013229352112 - :path: !!null - Mobylette::Helmet::Helpers#force_mobile_request_agent: - :operators: - :insert_faker: 1.2000000000000006 - :assignment: 1.2000000000000006 - :score: 1.697056274847715 - :path: lib/mobylette/helmet/helpers.rb:14 - Mobylette::Helmet::Helpers#reset_test_request_agent: - :operators: - :insert_faker: 1.2000000000000006 - :assignment: 1.2000000000000006 - :score: 1.697056274847715 - :path: lib/mobylette/helmet/helpers.rb:19 - Mobylette::Helmet::Helpers#insert_faker: - :operators: - :branch: 1.2000000000000006 - :included_modules: 1.4000000000000006 - :include?: 1.2000000000000006 - :send: 3.600000000000002 - :score: 6.31506136153878 - :path: lib/mobylette/helmet/helpers.rb:26 - - :name: Mobylette::Controllers::RespondToMobileRequestsMethods - :path: '' - :total_score: 5.044799302251778 - :highest_score: 5.044799302251778 - :average_score: 5.044799302251778 - :methods: - Mobylette::Controllers::RespondToMobileRequestsMethods#none: - :operators: - :extend: 2.400000000000001 - :branch: 1.2000000000000004 - :included: 1.2000000000000004 - :before_filter: 1.3000000000000005 - :score: 5.044799302251778 - :path: !!null - - :name: Mobylette::Helmet::Faker - :path: lib/mobylette/helmet/faker.rb - :total_score: 5.83249392876019 - :highest_score: 4.63249392876019 - :average_score: 2.916246964380095 - :methods: - Mobylette::Helmet::Faker#none: - :operators: - :extend: 2.200000000000001 - :branch: 1.1000000000000005 - :included: 1.1000000000000005 - :cattr_accessor: 1.2000000000000006 - :score: 4.63249392876019 - :path: !!null - Mobylette::Helmet::Faker#is_mobile_request?: - :operators: - :is_mobile_request: 1.2000000000000006 - :score: 1.2000000000000006 - :path: lib/mobylette/helmet/faker.rb:13 - - :name: Mobylette::Helmet - :path: lib/mobylette/helmet.rb - :total_score: 8.780337847847466 - :highest_score: 4.400000000000002 - :average_score: 2.926779282615822 - :methods: - Mobylette::Helmet#none: - :operators: - :extend: 2.200000000000001 - :autoload: 2.200000000000001 - :score: 4.400000000000002 - :path: !!null - Mobylette::Helmet#force_mobile_request_agent: - :operators: - :assignment: 2.4000000000000012 - :request: 1.2000000000000006 - :score: 2.683281572999749 - :path: lib/mobylette/helmet.rb:23 - Mobylette::Helmet#reset_test_request_agent: - :operators: - :assignment: 1.2000000000000006 - :request: 1.2000000000000006 - :score: 1.697056274847715 - :path: lib/mobylette/helmet.rb:38 - - :name: Mobylette::Controllers - :path: '' - :total_score: 2.6000000000000005 - :highest_score: 2.6000000000000005 - :average_score: 2.6000000000000005 - :methods: - Mobylette::Controllers#none: - :operators: - :autoload: 2.6000000000000005 - :score: 2.6000000000000005 - :path: !!null - - :name: Mobylette - :path: '' - :total_score: 2.4000000000000004 - :highest_score: 2.4000000000000004 - :average_score: 2.4000000000000004 - :methods: - Mobylette#none: - :operators: - :autoload: 1.2000000000000002 - :require: 1.2000000000000002 - :score: 2.4000000000000004 - :path: !!null - - :name: main - :path: '' - :total_score: 2.2 - :highest_score: 2.2 - :average_score: 2.2 - :methods: - main#none: - :operators: - :require: 1.1 - :register_alias: 1.1 - :score: 2.2 - :path: !!null -:flay: - :total_score: '0' - :matches: [] -:reek: - :matches: - - :file_path: lib/mobylette.rb - :code_smells: [] - - :file_path: lib/mobylette/controllers/helpers.rb - :code_smells: - - :method: Mobylette::Controllers::Helpers#sulfix_mobile_assets - :message: doesn't depend on instance state - :type: LowCohesion - - :method: Mobylette::Controllers::Helpers#sulfix_mobile_assets - :message: refers to source more than self - :type: LowCohesion - - :method: Mobylette::Controllers::Helpers#sulfix_mobile_assets - :message: refers to sources more than self - :type: LowCohesion - - :file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - :code_smells: - - :method: Mobylette::Controllers::RespondToMobileRequests::InstanceMethods#is_mobile_request? - :message: calls request twice - :type: Duplication - - :method: Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#handle_mobile - :message: calls request 3 times - :type: Duplication - - :method: Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#handle_mobile - :message: calls self.fall_back_format 3 times - :type: Duplication - - :file_path: lib/mobylette/helmet.rb - :code_smells: [] - - :file_path: lib/mobylette/helmet/faker.rb - :code_smells: [] - - :file_path: lib/mobylette/helmet/helpers.rb - :code_smells: - - :method: Mobylette::Helmet::Helpers#insert_faker - :message: doesn't depend on instance state - :type: LowCohesion - - :file_path: lib/mobylette/railtie.rb - :code_smells: - - :method: Mobylette::Railtie - :message: has no descriptive comment - :type: IrresponsibleModule - - :file_path: lib/mobylette/version.rb - :code_smells: [] -:roodi: - :total: !!null - :problems: [] -:rcov: - lib/mobylette/helmet.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' # Mobylette::Helmet provides helper methods to help you when - testing your controllers' - :was_run: true - - :content: ! ' # for a mobile request.' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # You must include Mobylette::Helmet into your test case, in - the README there is more' - :was_run: false - - :content: ! ' # documentation about how to make this test wide.' - :was_run: false - - :content: ! ' module Helmet' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' autoload "Helpers", "mobylette/helmet/helpers"' - :was_run: true - - :content: ! ' autoload "Faker" , "mobylette/helmet/faker"' - :was_run: true - - :content: ! ' # Force the request for the user_agent' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Remember to add it BEFORE the request' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Example:' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # it "should render the mobile_device view on mobile request" - do' - :was_run: false - - :content: ! ' # force_mobile_request_agent("Android")' - :was_run: false - - :content: ! ' # get :index' - :was_run: false - - :content: ! ' # response.should render_template(:mobile_device)' - :was_run: false - - :content: ! ' # end' - :was_run: false - - :content: ! ' def force_mobile_request_agent(user_agent = "Android")' - :was_run: false - - :content: ! ' request.user_agent = user_agent' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' # Reset the user_aget to the default ("Rails Testing")' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Remember to add it BEFORE the request' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Example:' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # it "should render the normal_view view on mobile request" - do' - :was_run: false - - :content: ! ' # reset_test_request_agent' - :was_run: false - - :content: ! ' # get :index' - :was_run: false - - :content: ! ' # response.should render_template(:normal_view)' - :was_run: false - - :content: ! ' # end' - :was_run: false - - :content: ! ' def reset_test_request_agent' - :was_run: false - - :content: ! ' request.user_agent = "Rails Testing"' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 25 - :methods: - Mobylette#force_mobile_request_agent: 33.33333333333333 - Mobylette#reset_test_request_agent: 33.33333333333333 - lib/mobylette.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' module Controllers' - :was_run: true - - :content: ! ' autoload "RespondToMobileRequests", "mobylette/controllers/respond_to_mobile_requests"' - :was_run: true - - :content: ! ' autoload "Helpers" , "mobylette/controllers/helpers"' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' autoload "Helmet" , "mobylette/helmet"' - :was_run: false - - :content: ! ' require ''mobylette/railtie''' - :was_run: true - - :content: end - :was_run: true - - :content: require 'action_controller' - :was_run: false - - :content: Mime::Type.register_alias "text/html", :mobile - :was_run: true - :percent_run: 70 - :methods: {} - lib/mobylette/controllers/helpers.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' module Controllers' - :was_run: true - - :content: ! ' #' - :was_run: false - - :content: ! ' # Mobylette::Controllers::Helpers include few methods to' - :was_run: false - - :content: ! ' # include different css/js files for the mobile and for' - :was_run: false - - :content: ! ' # the normal version of your layout' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Personal note: I''m rethinking and I guess that, since you' - :was_run: false - - :content: ! ' # may have (and probably will) a different layout file for - the' - :was_run: false - - :content: ! ' # "normal" and mobile version, you probably wont use this at - all' - :was_run: false - - :content: ! ' module Helpers' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' # Adds a "_mobile" sulfix to the files you include (when - the request is mobile)' - :was_run: false - - :content: ! ' def mobylette_stylesheet_link_tag(*sources)' - :was_run: false - - :content: ! ' options = sources.extract_options!' - :was_run: true - - :content: ! ' if is_mobile_request?' - :was_run: true - - :content: ! ' stylesheet_link_tag(*sulfix_mobile_assets(sources, :css).insert(-1, - options))' - :was_run: true - - :content: ! ' else' - :was_run: true - - :content: ! ' stylesheet_link_tag(*sources.insert(-1, options))' - :was_run: false - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' # Adds a "_mobile" sulfix to the files you include (when - the request is mobile)' - :was_run: false - - :content: ! ' def mobylette_javascript_include_tag(*sources)' - :was_run: false - - :content: ! ' options = sources.extract_options!' - :was_run: true - - :content: ! ' if is_mobile_request?' - :was_run: true - - :content: ! ' javascript_include_tag(*sulfix_mobile_assets(sources, - :js).insert(-1, options))' - :was_run: true - - :content: ! ' else' - :was_run: true - - :content: ! ' javascript_include_tag(*sources.insert(-1, options))' - :was_run: false - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' private' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Anex the "_mobile" sulfix to each string in the array,' - :was_run: false - - :content: ! ' # before the .#{extension}, if it exists' - :was_run: false - - :content: ! ' def sulfix_mobile_assets(sources, extension)' - :was_run: false - - :content: ! ' sources.map do |source|' - :was_run: true - - :content: ! ' if source =~ /.#{extension}/' - :was_run: true - - :content: ! ' "#{source.split(/.#{extension}$/)[0]}_mobile.#{extension}"' - :was_run: true - - :content: ! ' else' - :was_run: true - - :content: ! ' "#{source}_mobile"' - :was_run: false - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 52 - :methods: - Mobylette#mobylette_stylesheet_link_tag: 25.0 - Mobylette#mobylette_javascript_include_tag: 25.0 - Mobylette#sulfix_mobile_assets: 22.22222222222222 - lib/mobylette/helmet/helpers.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' module Helmet' - :was_run: true - - :content: ! ' # This module is only for testing the view''s helpers of the - module' - :was_run: true - - :content: ! ' # it simulates the Helmet helpers and the controller methods' - :was_run: false - - :content: ! ' # that are necessary for the tests' - :was_run: false - - :content: ! ' module Helpers' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' included do' - :was_run: true - - :content: ! ' cattr_accessor :user_agent' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' def force_mobile_request_agent' - :was_run: false - - :content: ! ' insert_faker' - :was_run: true - - :content: ! ' ActionController::Base.is_mobile_request = true' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' def reset_test_request_agent' - :was_run: false - - :content: ! ' insert_faker' - :was_run: true - - :content: ! ' ActionController::Base.is_mobile_request = false' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' private' - :was_run: false - - :content: ! ' def insert_faker' - :was_run: false - - :content: ! ' return if ActionController::Base.included_modules.include?(Mobylette::Helmet::Faker)' - :was_run: true - - :content: ! ' ActionController::Base.send(:include, Mobylette::Helmet::Faker)' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 69 - :methods: - Mobylette#force_mobile_request_agent: 25.0 - Mobylette#reset_test_request_agent: 25.0 - Mobylette#insert_faker: 25.0 - lib/mobylette/controllers/respond_to_mobile_requests.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' module Controllers' - :was_run: true - - :content: ! ' # Mobylette::Controllers::RespondToMobileRequests includes - the respond_to_mobile_requests' - :was_run: false - - :content: ! ' # to your ActionController::Base.' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # The respond_to_mobile_requests method enables the controller - mobile handling' - :was_run: false - - :content: ! ' module RespondToMobileRequests' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' included do' - :was_run: true - - :content: ! ' helper_method :is_mobile_request?' - :was_run: true - - :content: ! ' # List of mobile agents, from mobile_fu (https://github.com/brendanlim/mobile-fu)' - :was_run: true - - :content: ! ' MOBILE_USER_AGENTS = ''palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|'' - +' - :was_run: true - - :content: ! ' ''audiovox|motorola|samsung|telit|upg1|windows - ce|ucweb|astel|plucker|'' +' - :was_run: true - - :content: ! ' ''x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|'' - +' - :was_run: true - - :content: ! ' ''pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|'' - +' - :was_run: true - - :content: ! ' ''webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|'' +' - :was_run: true - - :content: ! ' ''mobile''' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' module ClassMethods' - :was_run: false - - :content: ! ' # This method enables the controller do handle mobile requests' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # You must add this to every controller you want to respond - differently to mobile devices,' - :was_run: false - - :content: ! ' # or make it application wide calling it from the ApplicationController' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Options:' - :was_run: false - - :content: ! ' # * :fall_back => :html' - :was_run: false - - :content: ! ' # You may pass a fall_back option to the method, it - will force the render' - :was_run: false - - :content: ! ' # to look for that other format, in case there is not - a .mobile file for the view.' - :was_run: false - - :content: ! ' # By default, it will fall back to the format of the - original request.' - :was_run: false - - :content: ! ' # If you don''t want fall back at all, pass :fall_back - => false' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' def respond_to_mobile_requests(options = {})' - :was_run: false - - :content: ! ' return if self.included_modules.include?(Mobylette::Controllers::RespondToMobileRequestsMethods)' - :was_run: true - - :content: ! ' cattr_accessor :fall_back_format' - :was_run: false - - :content: ! ' self.fall_back_format = options[:fall_back]' - :was_run: true - - :content: ! ' self.send(:include, Mobylette::Controllers::RespondToMobileRequestsMethods)' - :was_run: false - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' module InstanceMethods' - :was_run: false - - :content: ! ' private' - :was_run: false - - :content: ! ' # helper method to check if the current request if from - a mobile device or not' - :was_run: false - - :content: ! ' def is_mobile_request?' - :was_run: false - - :content: ! ' return true if (request.format.to_s == "mobile") or (params[:format] - == "mobile")' - :was_run: true - - :content: ! ' request.user_agent.to_s.downcase =~ /#{MOBILE_USER_AGENTS}/' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' # RespondToMobileRequestsMethods is included by respond_to_mobile_requests' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # This will check if the request is from a mobile device and - change' - :was_run: false - - :content: ! ' # the request format to :mobile' - :was_run: false - - :content: ! ' module RespondToMobileRequestsMethods' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' included do' - :was_run: true - - :content: ! ' before_filter :handle_mobile' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' module InstanceMethods' - :was_run: false - - :content: ! ' private' - :was_run: true - - :content: ! ' # Changes the request.form to :mobile, when the request - is from' - :was_run: false - - :content: ! ' # a mobile device' - :was_run: false - - :content: ! ' def handle_mobile' - :was_run: false - - :content: ! ' if is_mobile_request?' - :was_run: true - - :content: ! ' original_format = request.format.to_sym' - :was_run: true - - :content: ! ' request.format = :mobile' - :was_run: true - - :content: ! ' if self.fall_back_format != false' - :was_run: true - - :content: ! ' request.formats << Mime::Type.new((self.fall_back_format - if self.fall_back_format) || original_format)' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 52 - :methods: - Mobylette#respond_to_mobile_requests: 50.0 - Mobylette#is_mobile_request?: 25.0 - Mobylette#handle_mobile: 11.11111111111111 - lib/mobylette/helmet/faker.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' module Helmet' - :was_run: true - - :content: ! ' # Forces the helper to think that all requests come' - :was_run: false - - :content: ! ' # from a mobile device' - :was_run: false - - :content: ! ' module Faker' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' included do' - :was_run: true - - :content: ! ' cattr_accessor :is_mobile_request' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' def is_mobile_request?' - :was_run: false - - :content: ! ' is_mobile_request' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 67 - :methods: - Mobylette#is_mobile_request?: 33.33333333333333 - lib/mobylette/railtie.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' class Railtie < ::Rails::Railtie' - :was_run: true - - :content: ! ' initializer :mobylette do' - :was_run: true - - :content: ! ' ActiveSupport.on_load(:action_controller) do' - :was_run: true - - :content: ! ' ::ActionController::Base.send(:include, Mobylette::Controllers::RespondToMobileRequests)' - :was_run: true - - :content: ! ' ::ActionController::Base.helper Mobylette::Controllers::Helpers' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 90 - :methods: {} - :global_percent_run: 52.7 -:hotspots: - :files: - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb - class_name: !!null - method_name: !!null - hash: 4031988555471547402 - :details: - :churn: detected high level of churn (changed 5 times) - :rcov: average uncovered code is 33.3% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/faker.rb - class_name: !!null - method_name: !!null - hash: -1320828597441085005 - :details: - :rcov: uncovered code is 33.3% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: !!null - method_name: !!null - hash: 117964027637858853 - :details: - :reek: found 3 code smells - :churn: detected high level of churn (changed 16 times) - :rcov: average uncovered code is 28.7% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb - class_name: !!null - method_name: !!null - hash: -2589091859213638349 - :details: - :reek: found 1 code smells - :churn: detected high level of churn (changed 3 times) - :rcov: average uncovered code is 25.0% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: !!null - method_name: !!null - hash: -2010976377942857437 - :details: - :reek: found 3 code smells - :churn: detected high level of churn (changed 10 times) - :rcov: average uncovered code is 24.1% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb:76 - class_name: !!null - method_name: !!null - hash: -2673405952775493842 - :details: - :flog: complexity is 25.2 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb:52 - class_name: !!null - method_name: !!null - hash: 2583861898095884453 - :details: - :flog: complexity is 19.3 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb:26 - class_name: !!null - method_name: !!null - hash: 1295188944676677225 - :details: - :flog: complexity is 9.8 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb:16 - class_name: !!null - method_name: !!null - hash: 4497399214937041911 - :details: - :flog: complexity is 9.8 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb:37 - class_name: !!null - method_name: !!null - hash: -1357083643028374538 - :details: - :flog: complexity is 9.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/railtie.rb:8 - class_name: !!null - method_name: !!null - hash: -1204908533049299000 - :details: - :flog: complexity is 6.9 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb:26 - class_name: !!null - method_name: !!null - hash: -4133621839551933449 - :details: - :flog: complexity is 6.3 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb:40 - class_name: !!null - method_name: !!null - hash: 3880486540989219889 - :details: - :flog: complexity is 5.1 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb:23 - class_name: !!null - method_name: !!null - hash: 3220201136002057639 - :details: - :flog: complexity is 2.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb:19 - class_name: !!null - method_name: !!null - hash: -3938546682885686166 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb:14 - class_name: !!null - method_name: !!null - hash: -2523664642780364557 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb:38 - class_name: !!null - method_name: !!null - hash: 3309556124977960288 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/faker.rb:13 - class_name: !!null - method_name: !!null - hash: -1974011112281426555 - :details: - :flog: complexity is 1.2 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette.rb - class_name: !!null - method_name: !!null - hash: -1263139811812968281 - :details: - :churn: detected high level of churn (changed 8 times) - - :location: !ruby/object:MetricFu::Location - file_path: Gemfile - class_name: !!null - method_name: !!null - hash: -2516335185424333780 - :details: - :churn: detected high level of churn (changed 11 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/spec_helper.rb - class_name: !!null - method_name: !!null - hash: -3359517023979849187 - :details: - :churn: detected high level of churn (changed 10 times) - - :location: !ruby/object:MetricFu::Location - file_path: README.rdoc - class_name: !!null - method_name: !!null - hash: -1327748734090572649 - :details: - :churn: detected high level of churn (changed 16 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/config/routes.rb - class_name: !!null - method_name: !!null - hash: -3557814377825911303 - :details: - :churn: detected high level of churn (changed 8 times) - - :location: !ruby/object:MetricFu::Location - file_path: Gemfile.lock - class_name: !!null - method_name: !!null - hash: 1104042346890023718 - :details: - :churn: detected high level of churn (changed 12 times) - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/engine.rb - class_name: !!null - method_name: !!null - hash: 3228638806505301429 - :details: - :churn: detected high level of churn (changed 5 times) - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/railtie.rb - class_name: !!null - method_name: !!null - hash: 1255688775325308433 - :details: - :reek: found 1 code smells - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: .gitignore - class_name: !!null - method_name: !!null - hash: -4504650009409780781 - :details: - :churn: detected high level of churn (changed 4 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/controllers/application_controller_spec.rb - class_name: !!null - method_name: !!null - hash: 2964566127799032686 - :details: - :churn: detected high level of churn (changed 4 times) - - :location: !ruby/object:MetricFu::Location - file_path: TODO.rdoc - class_name: !!null - method_name: !!null - hash: 2669425395196239458 - :details: - :churn: detected high level of churn (changed 4 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/app/controllers/home_controller.rb - class_name: !!null - method_name: !!null - hash: -1709711208192373868 - :details: - :churn: detected high level of churn (changed 4 times) - - :location: !ruby/object:MetricFu::Location - file_path: CHANGELOG.rdoc - class_name: !!null - method_name: !!null - hash: -2039361998317327931 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/version.rb - class_name: !!null - method_name: !!null - hash: -2206831346799711886 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/controllers/desktop_only_controller_spec.rb - class_name: !!null - method_name: !!null - hash: -1302719736919663957 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/app/controllers/application_controller.rb - class_name: !!null - method_name: !!null - hash: -268717846351251623 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/controllers/actioncontroller_base_spec.rb - class_name: !!null - method_name: !!null - hash: -4151852866560622810 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: config/initializers/mobile_mime_types.rb - class_name: !!null - method_name: !!null - hash: 1861836418555359750 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: mobylette.gemspec - class_name: !!null - method_name: !!null - hash: -1403293196412339159 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/helpers/mobylette_helpers_spec.rb - class_name: !!null - method_name: !!null - hash: 2357911946787872181 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/app/views/layouts/application.html.erb - class_name: !!null - method_name: !!null - hash: 9231446674810798 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/app/views/layouts/application.mobile.erb - class_name: !!null - method_name: !!null - hash: -1312334453419488553 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/app/views/home/index.html.erb - class_name: !!null - method_name: !!null - hash: 3808675372654851053 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/controllers/home_controller_spec.rb - class_name: !!null - method_name: !!null - hash: -643433951259628329 - :details: - :churn: detected high level of churn (changed 8 times) - :classes: - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Mobylette - method_name: !!null - hash: 1127078764280111091 - :details: - :flog: complexity is 2.4 - :rcov: average uncovered code is 27.8% - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: RespondToMobileRequests - method_name: !!null - hash: 1957992759113255412 - :details: - :flog: complexity is 14.1 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: InstanceMethods - method_name: !!null - hash: 1703103870811795206 - :details: - :reek: found 3 code smells - :flog: average complexity is 11.8 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb:37 - class_name: ClassMethods - method_name: !!null - hash: 3050132251966709929 - :details: - :flog: complexity is 9.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/railtie.rb:8 - class_name: initializer - method_name: !!null - hash: -2298043145253401330 - :details: - :flog: complexity is 6.9 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: Helpers - method_name: !!null - hash: -3020320142483559131 - :details: - :reek: found 4 code smells - :flog: average complexity is 5.4 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: RespondToMobileRequestsMethods - method_name: !!null - hash: 720454466420826181 - :details: - :flog: complexity is 5.0 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Helmet - method_name: !!null - hash: 1035421190592118804 - :details: - :flog: average complexity is 2.9 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Faker - method_name: !!null - hash: -2785909516004027923 - :details: - :flog: average complexity is 2.9 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Controllers - method_name: !!null - hash: -1839539121938893154 - :details: - :flog: complexity is 2.6 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: main - method_name: !!null - hash: 841665147017659477 - :details: - :flog: complexity is 2.2 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/railtie.rb - class_name: Railtie - method_name: !!null - hash: -1815576609427783202 - :details: - :reek: found 1 code smells - :methods: - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: Mobylette - method_name: Mobylette#respond_to_mobile_requests - simple_method_name: ! '#respond_to_mobile_requests' - hash: 435875292522611010 - :details: - :rcov: uncovered code is 50.0% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb - class_name: Mobylette - method_name: Mobylette#reset_test_request_agent - simple_method_name: ! '#reset_test_request_agent' - hash: 30496347127118222 - :details: - :rcov: average uncovered code is 29.2% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb - class_name: Mobylette - method_name: Mobylette#force_mobile_request_agent - simple_method_name: ! '#force_mobile_request_agent' - hash: -661758521947166839 - :details: - :rcov: average uncovered code is 29.2% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: Mobylette - method_name: Mobylette#is_mobile_request? - simple_method_name: ! '#is_mobile_request?' - hash: -250871125129175485 - :details: - :rcov: average uncovered code is 29.2% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: InstanceMethods - method_name: InstanceMethods#handle_mobile - simple_method_name: ! '#handle_mobile' - hash: -161619565808645258 - :details: - :reek: found 2 code smells - :flog: complexity is 25.2 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: Mobylette - method_name: Mobylette#mobylette_javascript_include_tag - simple_method_name: ! '#mobylette_javascript_include_tag' - hash: 460418927741046551 - :details: - :rcov: uncovered code is 25.0% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb - class_name: Mobylette - method_name: Mobylette#insert_faker - simple_method_name: ! '#insert_faker' - hash: 202865185818091983 - :details: - :rcov: uncovered code is 25.0% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: Mobylette - method_name: Mobylette#mobylette_stylesheet_link_tag - simple_method_name: ! '#mobylette_stylesheet_link_tag' - hash: -139747529402004122 - :details: - :rcov: uncovered code is 25.0% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: Mobylette - method_name: Mobylette#sulfix_mobile_assets - simple_method_name: ! '#sulfix_mobile_assets' - hash: 3831883063641737300 - :details: - :rcov: uncovered code is 22.2% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: InstanceMethods - method_name: InstanceMethods#is_mobile_request? - simple_method_name: ! '#is_mobile_request?' - hash: 3859946802256305466 - :details: - :reek: found 1 code smells - :flog: complexity is 19.3 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: RespondToMobileRequests - method_name: RespondToMobileRequests#none - simple_method_name: ! '#none' - hash: -1692835556681480748 - :details: - :flog: complexity is 14.1 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: Mobylette - method_name: Mobylette#handle_mobile - simple_method_name: ! '#handle_mobile' - hash: 3407221860435910351 - :details: - :rcov: uncovered code is 11.1% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb:26 - class_name: Helpers - method_name: Helpers#mobylette_javascript_include_tag - simple_method_name: ! '#mobylette_javascript_include_tag' - hash: -1009369629486017935 - :details: - :flog: complexity is 9.8 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb:16 - class_name: Helpers - method_name: Helpers#mobylette_stylesheet_link_tag - simple_method_name: ! '#mobylette_stylesheet_link_tag' - hash: 2592345737306786878 - :details: - :flog: complexity is 9.8 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb:37 - class_name: ClassMethods - method_name: ClassMethods#respond_to_mobile_requests - simple_method_name: ! '#respond_to_mobile_requests' - hash: 3402835281330347563 - :details: - :flog: complexity is 9.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/railtie.rb:8 - class_name: initializer - method_name: initializer#mobylette - simple_method_name: ! '#mobylette' - hash: 758994720931463807 - :details: - :flog: complexity is 6.9 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb - class_name: Helpers - method_name: Helpers#insert_faker - simple_method_name: ! '#insert_faker' - hash: -1032457257041059147 - :details: - :reek: found 1 code smells - :flog: complexity is 6.3 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: Helpers - method_name: Helpers#sulfix_mobile_assets - simple_method_name: ! '#sulfix_mobile_assets' - hash: 3610269827339442079 - :details: - :reek: found 3 code smells - :flog: complexity is 5.1 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: RespondToMobileRequestsMethods - method_name: RespondToMobileRequestsMethods#none - simple_method_name: ! '#none' - hash: 3907795019904669680 - :details: - :flog: complexity is 5.0 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Faker - method_name: Faker#none - simple_method_name: ! '#none' - hash: 1638109036316188838 - :details: - :flog: complexity is 4.6 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Helpers - method_name: Helpers#none - simple_method_name: ! '#none' - hash: 4041480011242348926 - :details: - :flog: average complexity is 4.5 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Helmet - method_name: Helmet#none - simple_method_name: ! '#none' - hash: 1371954594264296735 - :details: - :flog: complexity is 4.4 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb:23 - class_name: Helmet - method_name: Helmet#force_mobile_request_agent - simple_method_name: ! '#force_mobile_request_agent' - hash: 404959666978006334 - :details: - :flog: complexity is 2.7 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Controllers - method_name: Controllers#none - simple_method_name: ! '#none' - hash: -4520928572902011146 - :details: - :flog: complexity is 2.6 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Mobylette - method_name: Mobylette#none - simple_method_name: ! '#none' - hash: -2321303308616815140 - :details: - :flog: complexity is 2.4 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: main - method_name: main#none - simple_method_name: ! '#none' - hash: 4057060770261915198 - :details: - :flog: complexity is 2.2 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb:38 - class_name: Helmet - method_name: Helmet#reset_test_request_agent - simple_method_name: ! '#reset_test_request_agent' - hash: 3459245677518319831 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb:14 - class_name: Helpers - method_name: Helpers#force_mobile_request_agent - simple_method_name: ! '#force_mobile_request_agent' - hash: 1227887528266058019 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb:19 - class_name: Helpers - method_name: Helpers#reset_test_request_agent - simple_method_name: ! '#reset_test_request_agent' - hash: 3995456109607318102 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: InstanceMethods - method_name: InstanceMethods#none - simple_method_name: ! '#none' - hash: -2233112655950772831 - :details: - :flog: average complexity is 1.3 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/faker.rb:13 - class_name: Faker - method_name: Faker#is_mobile_request? - simple_method_name: ! '#is_mobile_request?' - hash: 1016741441638077673 - :details: - :flog: complexity is 1.2 diff --git a/v1.0.0/metric_fu/output/churn.html b/v1.0.0/metric_fu/output/churn.html deleted file mode 100644 index 27aaa4f..0000000 --- a/v1.0.0/metric_fu/output/churn.html +++ /dev/null @@ -1,752 +0,0 @@ - - - - - - metrics - - - - - - - - -
    -

    Source Control Churn Results

    -

    Files that change a lot in your project may be bad a sign. - This task uses your source control log to identify those files. -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    File PathTimes Changed
    lib/mobylette/controllers/respond_to_mobile_requests.rb16
    README.rdoc16
    Gemfile.lock12
    Gemfile11
    spec/spec_helper.rb10
    lib/mobylette/controllers/helpers.rb10
    spec/controllers/home_controller_spec.rb8
    spec/dummy/config/routes.rb8
    lib/mobylette.rb8
    lib/mobylette/engine.rb5
    lib/mobylette/helmet.rb5
    .gitignore4
    spec/controllers/application_controller_spec.rb4
    TODO.rdoc4
    spec/dummy/app/controllers/home_controller.rb4
    CHANGELOG.rdoc3
    lib/mobylette/version.rb3
    spec/controllers/desktop_only_controller_spec.rb3
    spec/dummy/app/controllers/application_controller.rb3
    spec/controllers/actioncontroller_base_spec.rb3
    config/initializers/mobile_mime_types.rb3
    mobylette.gemspec3
    lib/mobylette/railtie.rb3
    lib/mobylette/helmet/helpers.rb3
    spec/helpers/mobylette_helpers_spec.rb3
    spec/dummy/app/views/layouts/application.html.erb3
    spec/dummy/app/views/layouts/application.mobile.erb3
    spec/dummy/app/views/home/index.html.erb3
    - - -

    Classes that change a lot in your project may be bad a sign.

    - - - - - - - -
    File PathTimes Changed
    - - - -

    Methods that change a lot in your project may be bad a sign.

    - - - - - - - -
    File PathTimes Changed
    - - - - -

    Generated on 2011-09-04 01:40:46 -0300

    - -
    - - diff --git a/v1.0.0/metric_fu/output/flay.html b/v1.0.0/metric_fu/output/flay.html deleted file mode 100644 index 58b0c9e..0000000 --- a/v1.0.0/metric_fu/output/flay.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - - - metrics - - - - - - - - -
    -

    Flay Results

    - -

    Flay analyzes ruby code for structural similarities.

    - - - - - - - -

    Total Score (lower is better): 0

    -
    Scores less than 100 are not shown or part of the total
    - - - - - - - - -
    FilesMatches
    -

    Generated on 2011-09-04 01:40:46 -0300

    - -
    - - diff --git a/v1.0.0/metric_fu/output/flay.js b/v1.0.0/metric_fu/output/flay.js deleted file mode 100644 index a162bbf..0000000 --- a/v1.0.0/metric_fu/output/flay.js +++ /dev/null @@ -1,11 +0,0 @@ - var g = new Bluff.Line('graph', "1000x600"); - g.theme_37signals(); - g.tooltips = true; - g.title_font_size = "24px" - g.legend_font_size = "12px" - g.marker_font_size = "10px" - - g.title = 'Flay: duplication'; - g.data('flay', [0]); - g.labels = {"0":"9/4"}; - g.draw(); diff --git a/v1.0.0/metric_fu/output/flog.html b/v1.0.0/metric_fu/output/flog.html deleted file mode 100644 index 05cead6..0000000 --- a/v1.0.0/metric_fu/output/flog.html +++ /dev/null @@ -1,1454 +0,0 @@ - - - - - - metrics - - - - - - - - -
    -

    Flog Results

    -

    Flog measures code complexity.

    - - - - - - - -

    Total Flog score for all methods: 148.1

    -

    Average Flog score for all methods: 6.2

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FileTotal scoreMethodsAverage scoreHighest score
    lib/mobylette/controllers/respond_to_mobile_requests.rb26.5213.225.2
    lib/mobylette/controllers/respond_to_mobile_requests.rb20.6210.319.3
    14.1114.114.1
    lib/mobylette/controllers/helpers.rb28.147.09.8
    lib/mobylette/controllers/respond_to_mobile_requests.rb9.719.79.7
    lib/mobylette/railtie.rb6.916.96.9
    lib/mobylette/helmet/helpers.rb15.443.96.3
    5.015.05.0
    lib/mobylette/helmet/faker.rb5.822.94.6
    lib/mobylette/helmet.rb8.832.94.4
    2.612.62.6
    2.412.42.4
    2.212.22.2
    - - -

    lib/mobylette/controllers/respond_to_mobile_requests.rb

    - - - -

    Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#none

    -

    Total Score: 1.3

    - - - - - - - - - - - -
    ScoreOperator
    1.3private
    - - -

    Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#handle_mobile

    -

    Total Score: 25.2

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    7.3branch
    1.4is_mobile_request?
    3.2assignment
    5.7request
    1.8format
    1.6to_sym
    6.3fall_back_format
    1.6==
    1.9formats
    1.9new
    1.7<<
    - - -

    lib/mobylette/controllers/respond_to_mobile_requests.rb

    - - - -

    Mobylette::Controllers::RespondToMobileRequests::InstanceMethods#none

    -

    Total Score: 1.3

    - - - - - - - - - - - -
    ScoreOperator
    1.3private
    - - -

    Mobylette::Controllers::RespondToMobileRequests::InstanceMethods#is_mobile_request?

    -

    Total Score: 19.3

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    2.8branch
    4.1request
    1.9format
    3.3to_s
    3.0==
    1.9params
    1.7[]
    1.8user_agent
    1.4downcase
    - - -

    - - - -

    Mobylette::Controllers::RespondToMobileRequests#none

    -

    Total Score: 14.1

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    2.4extend
    1.2branch
    1.2included
    1.4helper_method
    9.0+
    - - -

    lib/mobylette/controllers/helpers.rb

    - - - -

    Mobylette::Controllers::Helpers#none

    -

    Total Score: 3.3

    - - - - - - - - - - - - - - - - -
    ScoreOperator
    2.2extend
    1.1private
    - - -

    Mobylette::Controllers::Helpers#mobylette_stylesheet_link_tag

    -

    Total Score: 9.8

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    1.2assignment
    1.2extract_options!
    1.2branch
    1.2is_mobile_request?
    1.7sulfix_mobile_assets
    3.0insert
    2.6stylesheet_link_tag
    - - -

    Mobylette::Controllers::Helpers#mobylette_javascript_include_tag

    -

    Total Score: 9.8

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    1.2assignment
    1.2extract_options!
    1.2branch
    1.2is_mobile_request?
    1.7sulfix_mobile_assets
    3.0insert
    2.6javascript_include_tag
    - - -

    Mobylette::Controllers::Helpers#sulfix_mobile_assets

    -

    Total Score: 5.1

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    2.5branch
    1.2map
    1.3assignment
    1.6split
    1.4[]
    - - -

    lib/mobylette/controllers/respond_to_mobile_requests.rb

    - - - -

    Mobylette::Controllers::RespondToMobileRequests::ClassMethods#respond_to_mobile_requests

    -

    Total Score: 9.7

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    2.6assignment
    1.3branch
    1.5included_modules
    1.3include?
    1.3cattr_accessor
    1.3[]
    3.9send
    - - -

    lib/mobylette/railtie.rb

    - - - -

    Mobylette::Railtie::initializer#mobylette

    -

    Total Score: 6.9

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    1.0initializer
    1.0branch
    1.0on_load
    3.6send
    1.2helper
    - - -

    lib/mobylette/helmet/helpers.rb

    - - - -

    Mobylette::Helmet::Helpers#none

    -

    Total Score: 5.7

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    2.2extend
    1.1branch
    1.1included
    1.2cattr_accessor
    1.1private
    - - -

    Mobylette::Helmet::Helpers#force_mobile_request_agent

    -

    Total Score: 1.7

    - - - - - - - - - - - - - - - - -
    ScoreOperator
    1.2insert_faker
    1.2assignment
    - - -

    Mobylette::Helmet::Helpers#reset_test_request_agent

    -

    Total Score: 1.7

    - - - - - - - - - - - - - - - - -
    ScoreOperator
    1.2insert_faker
    1.2assignment
    - - -

    Mobylette::Helmet::Helpers#insert_faker

    -

    Total Score: 6.3

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    1.2branch
    1.4included_modules
    1.2include?
    3.6send
    - - -

    - - - -

    Mobylette::Controllers::RespondToMobileRequestsMethods#none

    -

    Total Score: 5.0

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    2.4extend
    1.2branch
    1.2included
    1.3before_filter
    - - -

    lib/mobylette/helmet/faker.rb

    - - - -

    Mobylette::Helmet::Faker#none

    -

    Total Score: 4.6

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ScoreOperator
    2.2extend
    1.1branch
    1.1included
    1.2cattr_accessor
    - - -

    Mobylette::Helmet::Faker#is_mobile_request?

    -

    Total Score: 1.2

    - - - - - - - - - - - -
    ScoreOperator
    1.2is_mobile_request
    - - -

    lib/mobylette/helmet.rb

    - - - -

    Mobylette::Helmet#none

    -

    Total Score: 4.4

    - - - - - - - - - - - - - - - - -
    ScoreOperator
    2.2extend
    2.2autoload
    - - -

    Mobylette::Helmet#force_mobile_request_agent

    -

    Total Score: 2.7

    - - - - - - - - - - - - - - - - -
    ScoreOperator
    2.4assignment
    1.2request
    - - -

    Mobylette::Helmet#reset_test_request_agent

    -

    Total Score: 1.7

    - - - - - - - - - - - - - - - - -
    ScoreOperator
    1.2assignment
    1.2request
    - - -

    - - - -

    Mobylette::Controllers#none

    -

    Total Score: 2.6

    - - - - - - - - - - - -
    ScoreOperator
    2.6autoload
    - - -

    - - - -

    Mobylette#none

    -

    Total Score: 2.4

    - - - - - - - - - - - - - - - - -
    ScoreOperator
    1.2autoload
    1.2require
    - - -

    - - - -

    main#none

    -

    Total Score: 2.2

    - - - - - - - - - - - - - - - - -
    ScoreOperator
    1.1require
    1.1register_alias
    - - -

    Generated on 2011-09-04 01:40:46 -0300

    - -
    - - diff --git a/v1.0.0/metric_fu/output/flog.js b/v1.0.0/metric_fu/output/flog.js deleted file mode 100644 index f123641..0000000 --- a/v1.0.0/metric_fu/output/flog.js +++ /dev/null @@ -1,12 +0,0 @@ - var g = new Bluff.Line('graph', "1000x600"); - g.theme_37signals(); - g.tooltips = true; - g.title_font_size = "24px" - g.legend_font_size = "12px" - g.marker_font_size = "10px" - - g.title = 'Flog: code complexity'; - g.data('average', [6.170522209788225]); - g.data('top 5% average', [22.24909577429176]) - g.labels = {"0":"9/4"}; - g.draw(); diff --git a/v1.0.0/metric_fu/output/hotspots.html b/v1.0.0/metric_fu/output/hotspots.html deleted file mode 100644 index c9f5d80..0000000 --- a/v1.0.0/metric_fu/output/hotspots.html +++ /dev/null @@ -1,2805 +0,0 @@ - - - - - - metrics - - - - - - - - -
    -

    Hotspot Results

    -

    Meta analysis of your metrics to find hotspots in your code.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Files -Classes -Methods
    - - lib/mobylette/helmet.rb - - - - - « - annotate - » - - -

    - - -
    - Churn: detected high level of churn (changed 5 times)
    - -
    - Rcov: average uncovered code is 33.3%
    - -
    - - : Mobylette - - -

    - - -
    - Flog: complexity is 2.4
    - -
    - Rcov: average uncovered code is 27.8%
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb : Mobylette#respond_to_mobile_requests - - - - - « - annotate - » - - -

    - - -
    - Rcov: uncovered code is 50.0%
    - -
    - - lib/mobylette/helmet/faker.rb - - - - - « - annotate - » - - -

    - - -
    - Rcov: uncovered code is 33.3%
    - -
    - - : RespondToMobileRequests - - -

    - - -
    - Flog: complexity is 14.1
    - -
    - - lib/mobylette/helmet.rb : Mobylette#reset_test_request_agent - - - - - « - annotate - » - - -

    - - -
    - Rcov: average uncovered code is 29.2%
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb - - - - - « - annotate - » - - -

    - - -
    - Reek: found 3 code smells
    - -
    - Churn: detected high level of churn (changed 16 times)
    - -
    - Rcov: average uncovered code is 28.7%
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb : InstanceMethods - - - - - « - annotate - » - - -

    - - -
    - Reek: found 3 code smells
    - -
    - Flog: average complexity is 11.8
    - -
    - - lib/mobylette/helmet.rb : Mobylette#force_mobile_request_agent - - - - - « - annotate - » - - -

    - - -
    - Rcov: average uncovered code is 29.2%
    - -
    - - lib/mobylette/helmet/helpers.rb - - - - - « - annotate - » - - -

    - - -
    - Reek: found 1 code smells
    - -
    - Churn: detected high level of churn (changed 3 times)
    - -
    - Rcov: average uncovered code is 25.0%
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb:37 : ClassMethods - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 9.7
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb : Mobylette#is_mobile_request? - - - - - « - annotate - » - - -

    - - -
    - Rcov: average uncovered code is 29.2%
    - -
    - - lib/mobylette/controllers/helpers.rb - - - - - « - annotate - » - - -

    - - -
    - Reek: found 3 code smells
    - -
    - Churn: detected high level of churn (changed 10 times)
    - -
    - Rcov: average uncovered code is 24.1%
    - -
    - - lib/mobylette/railtie.rb:8 : initializer - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 6.9
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb : InstanceMethods#handle_mobile - - - - - « - annotate - » - - -

    - - -
    - Reek: found 2 code smells
    - -
    - Flog: complexity is 25.2
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb:76 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 25.2
    - -
    - - lib/mobylette/controllers/helpers.rb : Helpers - - - - - « - annotate - » - - -

    - - -
    - Reek: found 4 code smells
    - -
    - Flog: average complexity is 5.4
    - -
    - - lib/mobylette/controllers/helpers.rb : Mobylette#mobylette_javascript_include_tag - - - - - « - annotate - » - - -

    - - -
    - Rcov: uncovered code is 25.0%
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb:52 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 19.3
    - -
    - - : RespondToMobileRequestsMethods - - -

    - - -
    - Flog: complexity is 5.0
    - -
    - - lib/mobylette/helmet/helpers.rb : Mobylette#insert_faker - - - - - « - annotate - » - - -

    - - -
    - Rcov: uncovered code is 25.0%
    - -
    - - lib/mobylette/controllers/helpers.rb:26 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 9.8
    - -
    - - : Helmet - - -

    - - -
    - Flog: average complexity is 2.9
    - -
    - - lib/mobylette/controllers/helpers.rb : Mobylette#mobylette_stylesheet_link_tag - - - - - « - annotate - » - - -

    - - -
    - Rcov: uncovered code is 25.0%
    - -
    - - lib/mobylette/controllers/helpers.rb:16 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 9.8
    - -
    - - : Faker - - -

    - - -
    - Flog: average complexity is 2.9
    - -
    - - lib/mobylette/controllers/helpers.rb : Mobylette#sulfix_mobile_assets - - - - - « - annotate - » - - -

    - - -
    - Rcov: uncovered code is 22.2%
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb:37 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 9.7
    - -
    - - : Controllers - - -

    - - -
    - Flog: complexity is 2.6
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb : InstanceMethods#is_mobile_request? - - - - - « - annotate - » - - -

    - - -
    - Reek: found 1 code smells
    - -
    - Flog: complexity is 19.3
    - -
    - - lib/mobylette/railtie.rb:8 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 6.9
    - -
    - - : main - - -

    - - -
    - Flog: complexity is 2.2
    - -
    - - : RespondToMobileRequests#none - - -

    - - -
    - Flog: complexity is 14.1
    - -
    - - lib/mobylette/helmet/helpers.rb:26 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 6.3
    - -
    - - lib/mobylette/railtie.rb : Railtie - - - - - « - annotate - » - - -

    - - -
    - Reek: found 1 code smells
    - -
    - - lib/mobylette/controllers/respond_to_mobile_requests.rb : Mobylette#handle_mobile - - - - - « - annotate - » - - -

    - - -
    - Rcov: uncovered code is 11.1%
    - -
    - - lib/mobylette/controllers/helpers.rb:40 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 5.1
    - -
      - - lib/mobylette/controllers/helpers.rb:26 : Helpers#mobylette_javascript_include_tag - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 9.8
    - -
    - - lib/mobylette/helmet.rb:23 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 2.7
    - -
      - - lib/mobylette/controllers/helpers.rb:16 : Helpers#mobylette_stylesheet_link_tag - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 9.8
    - -
    - - lib/mobylette/helmet/helpers.rb:19 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 1.7
    - -
      - - lib/mobylette/controllers/respond_to_mobile_requests.rb:37 : ClassMethods#respond_to_mobile_requests - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 9.7
    - -
    - - lib/mobylette/helmet/helpers.rb:14 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 1.7
    - -
      - - lib/mobylette/railtie.rb:8 : initializer#mobylette - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 6.9
    - -
    - - lib/mobylette/helmet.rb:38 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 1.7
    - -
      - - lib/mobylette/helmet/helpers.rb : Helpers#insert_faker - - - - - « - annotate - » - - -

    - - -
    - Reek: found 1 code smells
    - -
    - Flog: complexity is 6.3
    - -
    - - lib/mobylette/helmet/faker.rb:13 - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 1.2
    - -
      - - lib/mobylette/controllers/helpers.rb : Helpers#sulfix_mobile_assets - - - - - « - annotate - » - - -

    - - -
    - Reek: found 3 code smells
    - -
    - Flog: complexity is 5.1
    - -
    - - lib/mobylette.rb - - - - - « - annotate - » - - -

    - - -
    - Churn: detected high level of churn (changed 8 times)
    - -
      - - : RespondToMobileRequestsMethods#none - - -

    - - -
    - Flog: complexity is 5.0
    - -
    - - Gemfile - - - - - -

    - - -
    - Churn: detected high level of churn (changed 11 times)
    - -
      - - : Faker#none - - -

    - - -
    - Flog: complexity is 4.6
    - -
    - - spec/spec_helper.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 10 times)
    - -
      - - : Helpers#none - - -

    - - -
    - Flog: average complexity is 4.5
    - -
    - - README.rdoc - - - - - -

    - - -
    - Churn: detected high level of churn (changed 16 times)
    - -
      - - : Helmet#none - - -

    - - -
    - Flog: complexity is 4.4
    - -
    - - spec/dummy/config/routes.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 8 times)
    - -
      - - lib/mobylette/helmet.rb:23 : Helmet#force_mobile_request_agent - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 2.7
    - -
    - - Gemfile.lock - - - - - -

    - - -
    - Churn: detected high level of churn (changed 12 times)
    - -
      - - : Controllers#none - - -

    - - -
    - Flog: complexity is 2.6
    - -
    - - lib/mobylette/engine.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 5 times)
    - -
      - - : Mobylette#none - - -

    - - -
    - Flog: complexity is 2.4
    - -
    - - lib/mobylette/railtie.rb - - - - - « - annotate - » - - -

    - - -
    - Reek: found 1 code smells
    - -
    - Churn: detected high level of churn (changed 3 times)
    - -
      - - : main#none - - -

    - - -
    - Flog: complexity is 2.2
    - -
    - - .gitignore - - - - - -

    - - -
    - Churn: detected high level of churn (changed 4 times)
    - -
      - - lib/mobylette/helmet.rb:38 : Helmet#reset_test_request_agent - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 1.7
    - -
    - - spec/controllers/application_controller_spec.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 4 times)
    - -
      - - lib/mobylette/helmet/helpers.rb:14 : Helpers#force_mobile_request_agent - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 1.7
    - -
    - - TODO.rdoc - - - - - -

    - - -
    - Churn: detected high level of churn (changed 4 times)
    - -
      - - lib/mobylette/helmet/helpers.rb:19 : Helpers#reset_test_request_agent - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 1.7
    - -
    - - spec/dummy/app/controllers/home_controller.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 4 times)
    - -
      - - : InstanceMethods#none - - -

    - - -
    - Flog: average complexity is 1.3
    - -
    - - CHANGELOG.rdoc - - - - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
      - - lib/mobylette/helmet/faker.rb:13 : Faker#is_mobile_request? - - - - - « - annotate - » - - -

    - - -
    - Flog: complexity is 1.2
    - -
    - - lib/mobylette/version.rb - - - - - « - annotate - » - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
       
    - - spec/controllers/desktop_only_controller_spec.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
       
    - - spec/dummy/app/controllers/application_controller.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
       
    - - spec/controllers/actioncontroller_base_spec.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
       
    - - config/initializers/mobile_mime_types.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
       
    - - mobylette.gemspec - - - - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
       
    - - spec/helpers/mobylette_helpers_spec.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
       
    - - spec/dummy/app/views/layouts/application.html.erb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
       
    - - spec/dummy/app/views/layouts/application.mobile.erb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
       
    - - spec/dummy/app/views/home/index.html.erb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 3 times)
    - -
       
    - - spec/controllers/home_controller_spec.rb - - - - - -

    - - -
    - Churn: detected high level of churn (changed 8 times)
    - -
       
    - - - -

    Generated on 2011-09-04 01:40:46 -0300

    - -
    - - diff --git a/v1.0.0/metric_fu/output/index.html b/v1.0.0/metric_fu/output/index.html deleted file mode 100644 index d6f112b..0000000 --- a/v1.0.0/metric_fu/output/index.html +++ /dev/null @@ -1,572 +0,0 @@ - - - - - - metrics - - - - - - - - -
    -

    Metric Fu Results

    - -

    Generated on 2011-09-04 01:40:46 -0300

    - -
    - - diff --git a/v1.0.0/metric_fu/output/lib_mobylette.rb.html b/v1.0.0/metric_fu/output/lib_mobylette.rb.html deleted file mode 100644 index a9b0dd2..0000000 --- a/v1.0.0/metric_fu/output/lib_mobylette.rb.html +++ /dev/null @@ -1,31 +0,0 @@ -
    1 
    module Mobylette
    -
    2 
      module Controllers
    -
    3 
        autoload "RespondToMobileRequests", "mobylette/controllers/respond_to_mobile_requests"
    -
    4 
        autoload "Helpers"                , "mobylette/controllers/helpers"
    -
    5 
      end
    -
    6 
    -
    7 
      autoload "Helmet"                   , "mobylette/helmet"
    -
    8 
      require 'mobylette/railtie'
    -
    9 
    end
    -
    10 
    -
    11 
    require 'action_controller'
    -
    12 
    Mime::Type.register_alias "text/html", :mobile
    -
    diff --git a/v1.0.0/metric_fu/output/lib_mobylette_controllers_helpers.rb.html b/v1.0.0/metric_fu/output/lib_mobylette_controllers_helpers.rb.html deleted file mode 100644 index ebfac0b..0000000 --- a/v1.0.0/metric_fu/output/lib_mobylette_controllers_helpers.rb.html +++ /dev/null @@ -1,71 +0,0 @@ -
    1 
    module Mobylette
    -
    2 
      module Controllers
    -
    3 
    -
    4 
        #
    -
    5 
        # Mobylette::Controllers::Helpers include few methods to
    -
    6 
        # include different css/js files for the mobile and for
    -
    7 
        # the normal version of your layout
    -
    8 
        #
    -
    9 
        # Personal note: I'm rethinking and I guess that, since you
    -
    10 
        # may have (and probably will) a different layout file for the
    -
    11 
        # "normal" and mobile version, you probably wont use this at all
    -
    12 
        module Helpers
    -
    13 
          extend ActiveSupport::Concern
    -
    14 
    -
    15 
          # Adds a "_mobile" sulfix to the files you include (when the request is mobile)
    -
    16
    • Score of 9.85 » flog
          def mobylette_stylesheet_link_tag(*sources)
    -
    17 
            options = sources.extract_options!
    -
    18 
            if is_mobile_request?
    -
    19 
              stylesheet_link_tag(*sulfix_mobile_assets(sources, :css).insert(-1, options))
    -
    20 
            else
    -
    21 
              stylesheet_link_tag(*sources.insert(-1, options))
    -
    22 
            end
    -
    23 
          end
    -
    24 
    -
    25 
          # Adds a "_mobile" sulfix to the files you include (when the request is mobile)
    -
    26
    • Score of 9.85 » flog
          def mobylette_javascript_include_tag(*sources)
    -
    27 
            options = sources.extract_options!
    -
    28 
            if is_mobile_request?
    -
    29 
              javascript_include_tag(*sulfix_mobile_assets(sources, :js).insert(-1, options))
    -
    30 
            else
    -
    31 
              javascript_include_tag(*sources.insert(-1, options))
    -
    32 
            end
    -
    33 
          end
    -
    34 
    -
    35 
          private
    -
    36 
    -
    37 
          #
    -
    38 
          # Anex the "_mobile" sulfix to each string in the array,
    -
    39 
          # before the .#{extension}, if it exists
    -
    40
    • Score of 5.06 » flog
          def sulfix_mobile_assets(sources, extension)
    -
    41 
            sources.map do |source|
    -
    42 
              if source =~ /.#{extension}/
    -
    43 
                "#{source.split(/.#{extension}$/)[0]}_mobile.#{extension}"
    -
    44 
              else
    -
    45 
                "#{source}_mobile"
    -
    46 
              end
    -
    47 
            end
    -
    48 
          end
    -
    49 
        end
    -
    50 
    -
    51 
      end
    -
    52 
    end
    -
    diff --git a/v1.0.0/metric_fu/output/lib_mobylette_controllers_respond_to_mobile_requests.rb.html b/v1.0.0/metric_fu/output/lib_mobylette_controllers_respond_to_mobile_requests.rb.html deleted file mode 100644 index 5e10a42..0000000 --- a/v1.0.0/metric_fu/output/lib_mobylette_controllers_respond_to_mobile_requests.rb.html +++ /dev/null @@ -1,107 +0,0 @@ -
    1 
    module Mobylette
    -
    2 
      module Controllers
    -
    3 
    -
    4 
        # Mobylette::Controllers::RespondToMobileRequests includes the respond_to_mobile_requests
    -
    5 
        # to your ActionController::Base.
    -
    6 
        #
    -
    7 
        # The respond_to_mobile_requests method enables the controller mobile handling
    -
    8 
        module RespondToMobileRequests
    -
    9 
          extend ActiveSupport::Concern
    -
    10 
    -
    11 
          included do
    -
    12 
            helper_method :is_mobile_request?
    -
    13 
    -
    14 
            # List of mobile agents, from mobile_fu (https://github.com/brendanlim/mobile-fu)
    -
    15 
            MOBILE_USER_AGENTS =  'palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|' +
    -
    16 
                                  'audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|' +
    -
    17 
                                  'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' +
    -
    18 
                                  'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' +
    -
    19 
                                  'webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|'    +
    -
    20 
                                  'mobile'
    -
    21 
          end
    -
    22 
    -
    23 
          module ClassMethods
    -
    24 
    -
    25 
            # This method enables the controller do handle mobile requests
    -
    26 
            #
    -
    27 
            # You must add this to every controller you want to respond differently to mobile devices,
    -
    28 
            # or make it application wide calling it from the ApplicationController
    -
    29 
            #
    -
    30 
            # Options:
    -
    31 
            # * :fall_back => :html
    -
    32 
            #     You may pass a fall_back option to the method, it will force the render
    -
    33 
            #     to look for that other format, in case there is not a .mobile file for the view.
    -
    34 
            #     By default, it will fall back to the format of the original request.
    -
    35 
            #     If you don't want fall back at all, pass :fall_back => false
    -
    36 
            #
    -
    37
    • Score of 9.74 » flog
            def respond_to_mobile_requests(options = {})
    -
    38 
              return if self.included_modules.include?(Mobylette::Controllers::RespondToMobileRequestsMethods)
    -
    39 
    -
    40 
              cattr_accessor :fall_back_format
    -
    41 
              self.fall_back_format   = options[:fall_back]
    -
    42 
    -
    43 
              self.send(:include, Mobylette::Controllers::RespondToMobileRequestsMethods)
    -
    44 
            end
    -
    45 
          end
    -
    46 
    -
    47 
          module InstanceMethods
    -
    48 
    -
    49 
            private
    -
    50 
    -
    51 
            # helper method to check if the current request if from a mobile device or not
    -
    52
    • Score of 19.30 » flog
            def is_mobile_request?
    -
    53 
              return true if (request.format.to_s == "mobile") or (params[:format] == "mobile")
    -
    54 
              request.user_agent.to_s.downcase =~ /#{MOBILE_USER_AGENTS}/
    -
    55 
            end
    -
    56 
          end
    -
    57 
    -
    58 
        end
    -
    59 
    -
    60 
        # RespondToMobileRequestsMethods is included by respond_to_mobile_requests
    -
    61 
        #
    -
    62 
        # This will check if the request is from a mobile device and change
    -
    63 
        # the request format to :mobile
    -
    64 
        module RespondToMobileRequestsMethods
    -
    65 
          extend ActiveSupport::Concern
    -
    66 
    -
    67 
          included do
    -
    68 
            before_filter :handle_mobile
    -
    69 
          end
    -
    70 
    -
    71 
          module InstanceMethods
    -
    72 
            private
    -
    73 
    -
    74 
            # Changes the request.form to :mobile, when the request is from
    -
    75 
            # a mobile device
    -
    76
    • Score of 25.19 » flog
            def handle_mobile
    -
    77 
              if is_mobile_request?
    -
    78 
                original_format   = request.format.to_sym
    -
    79 
                request.format    = :mobile
    -
    80 
                if self.fall_back_format != false
    -
    81 
                  request.formats << Mime::Type.new((self.fall_back_format if self.fall_back_format) || original_format)
    -
    82 
                end
    -
    83 
              end
    -
    84 
            end
    -
    85 
          end
    -
    86 
        end
    -
    87 
      end
    -
    88 
    end
    -
    diff --git a/v1.0.0/metric_fu/output/lib_mobylette_helmet.rb.html b/v1.0.0/metric_fu/output/lib_mobylette_helmet.rb.html deleted file mode 100644 index a3d4e16..0000000 --- a/v1.0.0/metric_fu/output/lib_mobylette_helmet.rb.html +++ /dev/null @@ -1,62 +0,0 @@ -
    1 
    module Mobylette
    -
    2 
      # Mobylette::Helmet provides helper methods to help you when testing your controllers
    -
    3 
      # for a mobile request.
    -
    4 
      #
    -
    5 
      # You must include Mobylette::Helmet into your test case, in the README there is more
    -
    6 
      # documentation about how to make this test wide.
    -
    7 
      module Helmet
    -
    8 
        extend ActiveSupport::Concern
    -
    9 
        autoload "Helpers", "mobylette/helmet/helpers"
    -
    10 
        autoload "Faker"  , "mobylette/helmet/faker"
    -
    11 
    -
    12 
        # Force the request for the user_agent
    -
    13 
        #
    -
    14 
        # Remember to add it BEFORE the request
    -
    15 
        #
    -
    16 
        # Example:
    -
    17 
        #
    -
    18 
        #   it "should render the mobile_device view on mobile request" do
    -
    19 
        #     force_mobile_request_agent("Android")
    -
    20 
        #     get :index
    -
    21 
        #     response.should render_template(:mobile_device)
    -
    22 
        #   end
    -
    23
    • Score of 2.68 » flog
        def force_mobile_request_agent(user_agent = "Android")
    -
    24 
          request.user_agent = user_agent
    -
    25 
        end
    -
    26 
    -
    27 
        # Reset the user_aget to the default ("Rails Testing")
    -
    28 
        #
    -
    29 
        # Remember to add it BEFORE the request
    -
    30 
        #
    -
    31 
        # Example:
    -
    32 
        #
    -
    33 
        #   it "should render the normal_view view on mobile request" do
    -
    34 
        #     reset_test_request_agent
    -
    35 
        #     get :index
    -
    36 
        #     response.should render_template(:normal_view)
    -
    37 
        #   end
    -
    38
    • Score of 1.70 » flog
        def reset_test_request_agent
    -
    39 
          request.user_agent = "Rails Testing"
    -
    40 
        end
    -
    41 
    -
    42 
      end
    -
    43 
    end
    -
    diff --git a/v1.0.0/metric_fu/output/lib_mobylette_version.rb.html b/v1.0.0/metric_fu/output/lib_mobylette_version.rb.html deleted file mode 100644 index 62a072c..0000000 --- a/v1.0.0/metric_fu/output/lib_mobylette_version.rb.html +++ /dev/null @@ -1,22 +0,0 @@ -
    1 
    module Mobylette
    -
    2 
      VERSION = "1.0.0"
    -
    3 
    end
    -
    diff --git a/v1.0.0/metric_fu/output/rcov.html b/v1.0.0/metric_fu/output/rcov.html deleted file mode 100644 index 7c2a890..0000000 --- a/v1.0.0/metric_fu/output/rcov.html +++ /dev/null @@ -1,1757 +0,0 @@ - - - - - - metrics - - - - - - - - -
    -

    Rcov Code Coverage Results

    - -

    C0 code coverage information.

    - - - - - - - -

    Total Coverage: 52.7%

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    File PathPercent run
    lib/mobylette/helmet.rb25
    lib/mobylette/controllers/helpers.rb52
    lib/mobylette/controllers/respond_to_mobile_requests.rb52
    lib/mobylette/helmet/faker.rb67
    lib/mobylette/helmet/helpers.rb69
    lib/mobylette.rb70
    lib/mobylette/railtie.rb90
    - - -

    lib/mobylette/helmet.rb

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    module Mobylette
      # Mobylette::Helmet provides helper methods to help you when testing your controllers
      # for a mobile request.
      #
      # You must include Mobylette::Helmet into your test case, in the README there is more
      # documentation about how to make this test wide.
      module Helmet
        extend ActiveSupport::Concern
        autoload "Helpers", "mobylette/helmet/helpers"
        autoload "Faker"  , "mobylette/helmet/faker"
        # Force the request for the user_agent
        #
        # Remember to add it BEFORE the request
        #
        # Example:
        #
        #   it "should render the mobile_device view on mobile request" do
        #     force_mobile_request_agent("Android")
        #     get :index
        #     response.should render_template(:mobile_device)
        #   end
        def force_mobile_request_agent(user_agent = "Android")
          request.user_agent = user_agent
        end
        # Reset the user_aget to the default ("Rails Testing")
        #
        # Remember to add it BEFORE the request
        #
        # Example:
        #
        #   it "should render the normal_view view on mobile request" do
        #     reset_test_request_agent
        #     get :index
        #     response.should render_template(:normal_view)
        #   end
        def reset_test_request_agent
          request.user_agent = "Rails Testing"
        end
      end
    end
    -
    - -

    lib/mobylette/controllers/helpers.rb

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    module Mobylette
      module Controllers
        #
        # Mobylette::Controllers::Helpers include few methods to
        # include different css/js files for the mobile and for
        # the normal version of your layout
        #
        # Personal note: I'm rethinking and I guess that, since you
        # may have (and probably will) a different layout file for the
        # "normal" and mobile version, you probably wont use this at all
        module Helpers
          extend ActiveSupport::Concern
          # Adds a "_mobile" sulfix to the files you include (when the request is mobile)
          def mobylette_stylesheet_link_tag(*sources)
            options = sources.extract_options!
            if is_mobile_request?
              stylesheet_link_tag(*sulfix_mobile_assets(sources, :css).insert(-1, options))
            else
              stylesheet_link_tag(*sources.insert(-1, options))
            end
          end
          # Adds a "_mobile" sulfix to the files you include (when the request is mobile)
          def mobylette_javascript_include_tag(*sources)
            options = sources.extract_options!
            if is_mobile_request?
              javascript_include_tag(*sulfix_mobile_assets(sources, :js).insert(-1, options))
            else
              javascript_include_tag(*sources.insert(-1, options))
            end
          end
          private
          #
          # Anex the "_mobile" sulfix to each string in the array,
          # before the .#{extension}, if it exists
          def sulfix_mobile_assets(sources, extension)
            sources.map do |source|
              if source =~ /.#{extension}/
                "#{source.split(/.#{extension}$/)[0]}_mobile.#{extension}"
              else
                "#{source}_mobile"
              end
            end
          end
        end
      end
    end
    -
    - -

    lib/mobylette/controllers/respond_to_mobile_requests.rb

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    module Mobylette
      module Controllers
        # Mobylette::Controllers::RespondToMobileRequests includes the respond_to_mobile_requests
        # to your ActionController::Base.
        #
        # The respond_to_mobile_requests method enables the controller mobile handling
        module RespondToMobileRequests
          extend ActiveSupport::Concern
          included do
            helper_method :is_mobile_request?
            # List of mobile agents, from mobile_fu (https://github.com/brendanlim/mobile-fu)
            MOBILE_USER_AGENTS =  'palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|' +
                                  'audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|' +
                                  'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' +
                                  'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' +
                                  'webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|'    +
                                  'mobile'
          end
          module ClassMethods
            # This method enables the controller do handle mobile requests
            #
            # You must add this to every controller you want to respond differently to mobile devices,
            # or make it application wide calling it from the ApplicationController
            #
            # Options:
            # * :fall_back => :html
            #     You may pass a fall_back option to the method, it will force the render
            #     to look for that other format, in case there is not a .mobile file for the view.
            #     By default, it will fall back to the format of the original request.
            #     If you don't want fall back at all, pass :fall_back => false
            #
            def respond_to_mobile_requests(options = {})
              return if self.included_modules.include?(Mobylette::Controllers::RespondToMobileRequestsMethods)
              cattr_accessor :fall_back_format
              self.fall_back_format   = options[:fall_back]
              self.send(:include, Mobylette::Controllers::RespondToMobileRequestsMethods)
            end
          end
          module InstanceMethods
            private
            # helper method to check if the current request if from a mobile device or not
            def is_mobile_request?
              return true if (request.format.to_s == "mobile") or (params[:format] == "mobile")
              request.user_agent.to_s.downcase =~ /#{MOBILE_USER_AGENTS}/
            end
          end
        end
        # RespondToMobileRequestsMethods is included by respond_to_mobile_requests
        #
        # This will check if the request is from a mobile device and change
        # the request format to :mobile
        module RespondToMobileRequestsMethods
          extend ActiveSupport::Concern
          included do
            before_filter :handle_mobile
          end
          module InstanceMethods
            private
            # Changes the request.form to :mobile, when the request is from
            # a mobile device
            def handle_mobile
              if is_mobile_request?
                original_format   = request.format.to_sym
                request.format    = :mobile
                if self.fall_back_format != false
                  request.formats << Mime::Type.new((self.fall_back_format if self.fall_back_format) || original_format)
                end
              end
            end
          end
        end
      end
    end
    -
    - -

    lib/mobylette/helmet/faker.rb

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    module Mobylette
      module Helmet
        # Forces the helper to think that all requests come
        # from a mobile device
        module Faker
          extend ActiveSupport::Concern
          included do
            cattr_accessor :is_mobile_request
          end
          def is_mobile_request?
            is_mobile_request
          end
        end
      end
    end
    -
    - -

    lib/mobylette/helmet/helpers.rb

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    module Mobylette
      module Helmet
        # This module is only for testing the view's helpers of the module
        # it simulates the Helmet helpers and the controller methods
        # that are necessary for the tests
        module Helpers
          extend ActiveSupport::Concern
          included do
            cattr_accessor :user_agent
          end
          def force_mobile_request_agent
            insert_faker
            ActionController::Base.is_mobile_request = true
          end
          def reset_test_request_agent
            insert_faker
            ActionController::Base.is_mobile_request = false
          end
          private
          def insert_faker
            return if ActionController::Base.included_modules.include?(Mobylette::Helmet::Faker)
            ActionController::Base.send(:include, Mobylette::Helmet::Faker)
          end
        end
      end
    end
    -
    - -

    lib/mobylette.rb

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    module Mobylette
      module Controllers
        autoload "RespondToMobileRequests", "mobylette/controllers/respond_to_mobile_requests"
        autoload "Helpers"                , "mobylette/controllers/helpers"
      end
      autoload "Helmet"                   , "mobylette/helmet"
      require 'mobylette/railtie'
    end
    require 'action_controller'
    Mime::Type.register_alias "text/html", :mobile
    -
    - -

    lib/mobylette/railtie.rb

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    module Mobylette
      class Railtie < ::Rails::Railtie
        initializer :mobylette do
          ActiveSupport.on_load(:action_controller) do
            ::ActionController::Base.send(:include, Mobylette::Controllers::RespondToMobileRequests)
            ::ActionController::Base.helper Mobylette::Controllers::Helpers
          end
        end
      end
    end
    -
    - -

    Generated on 2011-09-04 01:40:46 -0300

    - - - - diff --git a/v1.0.0/metric_fu/output/rcov.js b/v1.0.0/metric_fu/output/rcov.js deleted file mode 100644 index dc1cae1..0000000 --- a/v1.0.0/metric_fu/output/rcov.js +++ /dev/null @@ -1,11 +0,0 @@ - var g = new Bluff.Line('graph', "1000x600"); - g.theme_37signals(); - g.tooltips = true; - g.title_font_size = "24px" - g.legend_font_size = "12px" - g.marker_font_size = "10px" - - g.title = 'Rcov: code coverage'; - g.data('rcov', [52.7]); - g.labels = {"0":"9/4"}; - g.draw(); diff --git a/v1.0.0/metric_fu/output/reek.html b/v1.0.0/metric_fu/output/reek.html deleted file mode 100644 index 5e6d549..0000000 --- a/v1.0.0/metric_fu/output/reek.html +++ /dev/null @@ -1,694 +0,0 @@ - - - - - - metrics - - - - - - - - -
    -

    Reek Results

    - -

    Reek detects common code smells in ruby code.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    File PathMethodDescriptionType
    lib/mobylette/controllers/helpers.rb - Mobylette::Controllers::Helpers#sulfix_mobile_assets - - doesn't depend on instance state - - LowCohesion -
    lib/mobylette/controllers/helpers.rb - Mobylette::Controllers::Helpers#sulfix_mobile_assets - - refers to source more than self - - LowCohesion -
    lib/mobylette/controllers/helpers.rb - Mobylette::Controllers::Helpers#sulfix_mobile_assets - - refers to sources more than self - - LowCohesion -
    lib/mobylette/controllers/respond_to_mobile_requests.rb - Mobylette::Controllers::RespondToMobileRequests::InstanceMethods#is_mobile_request? - - calls request twice - - Duplication -
    lib/mobylette/controllers/respond_to_mobile_requests.rb - Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#handle_mobile - - calls request 3 times - - Duplication -
    lib/mobylette/controllers/respond_to_mobile_requests.rb - Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#handle_mobile - - calls self.fall_back_format 3 times - - Duplication -
    lib/mobylette/helmet/helpers.rb - Mobylette::Helmet::Helpers#insert_faker - - doesn't depend on instance state - - LowCohesion -
    lib/mobylette/railtie.rb - Mobylette::Railtie - - has no descriptive comment - - IrresponsibleModule -
    -

    Generated on 2011-09-04 01:40:46 -0300

    - -
    - - diff --git a/v1.0.0/metric_fu/output/reek.js b/v1.0.0/metric_fu/output/reek.js deleted file mode 100644 index 135c6e0..0000000 --- a/v1.0.0/metric_fu/output/reek.js +++ /dev/null @@ -1,14 +0,0 @@ - var g = new Bluff.Line('graph', "1000x600"); - g.theme_37signals(); - g.tooltips = true; - g.title_font_size = "24px" - g.legend_font_size = "12px" - g.marker_font_size = "10px" - - g.title = 'Reek: code smells'; - g.data('Duplication', [3]) -g.data('IrresponsibleModule', [1]) -g.data('LowCohesion', [4]) - - g.labels = {"0":"9/4"}; - g.draw(); diff --git a/v1.0.0/metric_fu/output/roodi.html b/v1.0.0/metric_fu/output/roodi.html deleted file mode 100644 index ca7125f..0000000 --- a/v1.0.0/metric_fu/output/roodi.html +++ /dev/null @@ -1,563 +0,0 @@ - - - - - - metrics - - - - - - - - -
    -

    Roodi Results

    - -

    Roodi parses your Ruby code and warns you about design issues you have based on the checks that is has configured.

    - - - - - - - - - - - - - - -
    File PathWarning
    -

    Generated on 2011-09-04 01:40:46 -0300

    - -
    - - diff --git a/v1.0.0/metric_fu/output/roodi.js b/v1.0.0/metric_fu/output/roodi.js deleted file mode 100644 index 463374a..0000000 --- a/v1.0.0/metric_fu/output/roodi.js +++ /dev/null @@ -1,11 +0,0 @@ - var g = new Bluff.Line('graph', "1000x600"); - g.theme_37signals(); - g.tooltips = true; - g.title_font_size = "24px" - g.legend_font_size = "12px" - g.marker_font_size = "10px" - - g.title = 'Roodi: design problems'; - g.data('roodi', [0]); - g.labels = {"0":"9/4"}; - g.draw(); diff --git a/v1.0.0/metric_fu/report.yml b/v1.0.0/metric_fu/report.yml deleted file mode 100644 index 3d578be..0000000 --- a/v1.0.0/metric_fu/report.yml +++ /dev/null @@ -1,1540 +0,0 @@ ---- -:churn: - :changes: - - :file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - :times_changed: 16 - - :file_path: README.rdoc - :times_changed: 16 - - :file_path: Gemfile.lock - :times_changed: 12 - - :file_path: Gemfile - :times_changed: 11 - - :file_path: spec/spec_helper.rb - :times_changed: 10 - - :file_path: lib/mobylette/controllers/helpers.rb - :times_changed: 10 - - :file_path: spec/controllers/home_controller_spec.rb - :times_changed: 8 - - :file_path: spec/dummy/config/routes.rb - :times_changed: 8 - - :file_path: lib/mobylette.rb - :times_changed: 8 - - :file_path: lib/mobylette/engine.rb - :times_changed: 5 - - :file_path: lib/mobylette/helmet.rb - :times_changed: 5 - - :file_path: .gitignore - :times_changed: 4 - - :file_path: spec/controllers/application_controller_spec.rb - :times_changed: 4 - - :file_path: TODO.rdoc - :times_changed: 4 - - :file_path: spec/dummy/app/controllers/home_controller.rb - :times_changed: 4 - - :file_path: CHANGELOG.rdoc - :times_changed: 3 - - :file_path: lib/mobylette/version.rb - :times_changed: 3 - - :file_path: spec/controllers/desktop_only_controller_spec.rb - :times_changed: 3 - - :file_path: spec/dummy/app/controllers/application_controller.rb - :times_changed: 3 - - :file_path: spec/controllers/actioncontroller_base_spec.rb - :times_changed: 3 - - :file_path: config/initializers/mobile_mime_types.rb - :times_changed: 3 - - :file_path: mobylette.gemspec - :times_changed: 3 - - :file_path: lib/mobylette/railtie.rb - :times_changed: 3 - - :file_path: lib/mobylette/helmet/helpers.rb - :times_changed: 3 - - :file_path: spec/helpers/mobylette_helpers_spec.rb - :times_changed: 3 - - :file_path: spec/dummy/app/views/layouts/application.html.erb - :times_changed: 3 - - :file_path: spec/dummy/app/views/layouts/application.mobile.erb - :times_changed: 3 - - :file_path: spec/dummy/app/views/home/index.html.erb - :times_changed: 3 - :class_churn: [] - :method_churn: [] - :changed_files: - - Gemfile - - Gemfile.lock - - Rakefile - :changed_classes: [] - :changed_methods: [] -:flog: - :total: 148.0925330349174 - :average: 6.170522209788225 - :method_containers: - - :name: Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb - :total_score: 26.494046915888696 - :highest_score: 25.194046915888695 - :average_score: 13.247023457944348 - :methods: - Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#none: - :operators: - :private: 1.3000000000000005 - :score: 1.3000000000000005 - :path: !!null - Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#handle_mobile: - :operators: - :branch: 7.300000000000004 - :is_mobile_request?: 1.4000000000000006 - :assignment: 3.200000000000002 - :request: 5.700000000000003 - :format: 1.800000000000001 - :to_sym: 1.600000000000001 - :fall_back_format: 6.3000000000000025 - :==: 1.600000000000001 - :formats: 1.900000000000001 - :new: 1.900000000000001 - :<<: 1.700000000000001 - :score: 25.194046915888695 - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb:76 - - :name: Mobylette::Controllers::RespondToMobileRequests::InstanceMethods - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb - :total_score: 20.604144632694826 - :highest_score: 19.304144632694825 - :average_score: 10.302072316347413 - :methods: - Mobylette::Controllers::RespondToMobileRequests::InstanceMethods#none: - :operators: - :private: 1.3000000000000005 - :score: 1.3000000000000005 - :path: !!null - Mobylette::Controllers::RespondToMobileRequests::InstanceMethods#is_mobile_request?: - :operators: - :branch: 2.800000000000001 - :request: 4.100000000000001 - :format: 1.9000000000000006 - :to_s: 3.300000000000001 - :==: 3.0000000000000013 - :params: 1.9000000000000006 - :[]: 1.7000000000000006 - :user_agent: 1.8000000000000005 - :downcase: 1.4000000000000006 - :score: 19.304144632694825 - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb:52 - - :name: Mobylette::Controllers::RespondToMobileRequests - :path: '' - :total_score: 14.051334456200241 - :highest_score: 14.051334456200241 - :average_score: 14.051334456200241 - :methods: - Mobylette::Controllers::RespondToMobileRequests#none: - :operators: - :extend: 2.4000000000000004 - :branch: 1.2000000000000002 - :included: 1.2000000000000002 - :helper_method: 1.4000000000000004 - :+: 9.000000000000004 - :score: 14.051334456200241 - :path: !!null - - :name: Mobylette::Controllers::Helpers - :path: lib/mobylette/controllers/helpers.rb - :total_score: 28.052336776102663 - :highest_score: 9.847334664770973 - :average_score: 7.013084194025666 - :methods: - Mobylette::Controllers::Helpers#none: - :operators: - :extend: 2.2 - :private: 1.1 - :score: 3.3000000000000003 - :path: !!null - Mobylette::Controllers::Helpers#mobylette_stylesheet_link_tag: - :operators: - :assignment: 1.2000000000000002 - :extract_options!: 1.2000000000000002 - :branch: 1.2000000000000002 - :is_mobile_request?: 1.2000000000000002 - :sulfix_mobile_assets: 1.7000000000000002 - :insert: 3.0000000000000004 - :stylesheet_link_tag: 2.6000000000000005 - :score: 9.847334664770973 - :path: lib/mobylette/controllers/helpers.rb:16 - Mobylette::Controllers::Helpers#mobylette_javascript_include_tag: - :operators: - :assignment: 1.2000000000000002 - :extract_options!: 1.2000000000000002 - :branch: 1.2000000000000002 - :is_mobile_request?: 1.2000000000000002 - :sulfix_mobile_assets: 1.7000000000000002 - :insert: 3.0000000000000004 - :javascript_include_tag: 2.6000000000000005 - :score: 9.847334664770973 - :path: lib/mobylette/controllers/helpers.rb:26 - Mobylette::Controllers::Helpers#sulfix_mobile_assets: - :operators: - :branch: 2.5000000000000004 - :map: 1.2000000000000002 - :assignment: 1.3000000000000003 - :split: 1.6000000000000003 - :[]: 1.4000000000000004 - :score: 5.057667446560718 - :path: lib/mobylette/controllers/helpers.rb:40 - - :name: Mobylette::Controllers::RespondToMobileRequests::ClassMethods - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb - :total_score: 9.743715923609436 - :highest_score: 9.743715923609436 - :average_score: 9.743715923609436 - :methods: - Mobylette::Controllers::RespondToMobileRequests::ClassMethods#respond_to_mobile_requests: - :operators: - :assignment: 2.600000000000001 - :branch: 1.3000000000000005 - :included_modules: 1.5000000000000004 - :include?: 1.3000000000000005 - :cattr_accessor: 1.3000000000000005 - :[]: 1.3000000000000005 - :send: 3.9000000000000012 - :score: 9.743715923609436 - :path: lib/mobylette/controllers/respond_to_mobile_requests.rb:37 - - :name: Mobylette::Railtie::initializer - :path: lib/mobylette/railtie.rb - :total_score: 6.873136110975837 - :highest_score: 6.873136110975837 - :average_score: 6.873136110975837 - :methods: - Mobylette::Railtie::initializer#mobylette: - :operators: - :initializer: 1.0000000000000004 - :branch: 1.0000000000000004 - :on_load: 1.0000000000000004 - :send: 3.600000000000002 - :helper: 1.2000000000000006 - :score: 6.873136110975837 - :path: lib/mobylette/railtie.rb:8 - - :name: Mobylette::Helmet::Helpers - :path: lib/mobylette/helmet/helpers.rb - :total_score: 15.416187140586324 - :highest_score: 6.31506136153878 - :average_score: 3.854046785146581 - :methods: - Mobylette::Helmet::Helpers#none: - :operators: - :extend: 2.200000000000001 - :branch: 1.1000000000000005 - :included: 1.1000000000000005 - :cattr_accessor: 1.2000000000000006 - :private: 1.1000000000000005 - :score: 5.707013229352112 - :path: !!null - Mobylette::Helmet::Helpers#force_mobile_request_agent: - :operators: - :insert_faker: 1.2000000000000006 - :assignment: 1.2000000000000006 - :score: 1.697056274847715 - :path: lib/mobylette/helmet/helpers.rb:14 - Mobylette::Helmet::Helpers#reset_test_request_agent: - :operators: - :insert_faker: 1.2000000000000006 - :assignment: 1.2000000000000006 - :score: 1.697056274847715 - :path: lib/mobylette/helmet/helpers.rb:19 - Mobylette::Helmet::Helpers#insert_faker: - :operators: - :branch: 1.2000000000000006 - :included_modules: 1.4000000000000006 - :include?: 1.2000000000000006 - :send: 3.600000000000002 - :score: 6.31506136153878 - :path: lib/mobylette/helmet/helpers.rb:26 - - :name: Mobylette::Controllers::RespondToMobileRequestsMethods - :path: '' - :total_score: 5.044799302251778 - :highest_score: 5.044799302251778 - :average_score: 5.044799302251778 - :methods: - Mobylette::Controllers::RespondToMobileRequestsMethods#none: - :operators: - :extend: 2.400000000000001 - :branch: 1.2000000000000004 - :included: 1.2000000000000004 - :before_filter: 1.3000000000000005 - :score: 5.044799302251778 - :path: !!null - - :name: Mobylette::Helmet::Faker - :path: lib/mobylette/helmet/faker.rb - :total_score: 5.83249392876019 - :highest_score: 4.63249392876019 - :average_score: 2.916246964380095 - :methods: - Mobylette::Helmet::Faker#none: - :operators: - :extend: 2.200000000000001 - :branch: 1.1000000000000005 - :included: 1.1000000000000005 - :cattr_accessor: 1.2000000000000006 - :score: 4.63249392876019 - :path: !!null - Mobylette::Helmet::Faker#is_mobile_request?: - :operators: - :is_mobile_request: 1.2000000000000006 - :score: 1.2000000000000006 - :path: lib/mobylette/helmet/faker.rb:13 - - :name: Mobylette::Helmet - :path: lib/mobylette/helmet.rb - :total_score: 8.780337847847466 - :highest_score: 4.400000000000002 - :average_score: 2.926779282615822 - :methods: - Mobylette::Helmet#none: - :operators: - :extend: 2.200000000000001 - :autoload: 2.200000000000001 - :score: 4.400000000000002 - :path: !!null - Mobylette::Helmet#force_mobile_request_agent: - :operators: - :assignment: 2.4000000000000012 - :request: 1.2000000000000006 - :score: 2.683281572999749 - :path: lib/mobylette/helmet.rb:23 - Mobylette::Helmet#reset_test_request_agent: - :operators: - :assignment: 1.2000000000000006 - :request: 1.2000000000000006 - :score: 1.697056274847715 - :path: lib/mobylette/helmet.rb:38 - - :name: Mobylette::Controllers - :path: '' - :total_score: 2.6000000000000005 - :highest_score: 2.6000000000000005 - :average_score: 2.6000000000000005 - :methods: - Mobylette::Controllers#none: - :operators: - :autoload: 2.6000000000000005 - :score: 2.6000000000000005 - :path: !!null - - :name: Mobylette - :path: '' - :total_score: 2.4000000000000004 - :highest_score: 2.4000000000000004 - :average_score: 2.4000000000000004 - :methods: - Mobylette#none: - :operators: - :autoload: 1.2000000000000002 - :require: 1.2000000000000002 - :score: 2.4000000000000004 - :path: !!null - - :name: main - :path: '' - :total_score: 2.2 - :highest_score: 2.2 - :average_score: 2.2 - :methods: - main#none: - :operators: - :require: 1.1 - :register_alias: 1.1 - :score: 2.2 - :path: !!null -:flay: - :total_score: '0' - :matches: [] -:reek: - :matches: - - :file_path: lib/mobylette.rb - :code_smells: [] - - :file_path: lib/mobylette/controllers/helpers.rb - :code_smells: - - :method: Mobylette::Controllers::Helpers#sulfix_mobile_assets - :message: doesn't depend on instance state - :type: LowCohesion - - :method: Mobylette::Controllers::Helpers#sulfix_mobile_assets - :message: refers to source more than self - :type: LowCohesion - - :method: Mobylette::Controllers::Helpers#sulfix_mobile_assets - :message: refers to sources more than self - :type: LowCohesion - - :file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - :code_smells: - - :method: Mobylette::Controllers::RespondToMobileRequests::InstanceMethods#is_mobile_request? - :message: calls request twice - :type: Duplication - - :method: Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#handle_mobile - :message: calls request 3 times - :type: Duplication - - :method: Mobylette::Controllers::RespondToMobileRequestsMethods::InstanceMethods#handle_mobile - :message: calls self.fall_back_format 3 times - :type: Duplication - - :file_path: lib/mobylette/helmet.rb - :code_smells: [] - - :file_path: lib/mobylette/helmet/faker.rb - :code_smells: [] - - :file_path: lib/mobylette/helmet/helpers.rb - :code_smells: - - :method: Mobylette::Helmet::Helpers#insert_faker - :message: doesn't depend on instance state - :type: LowCohesion - - :file_path: lib/mobylette/railtie.rb - :code_smells: - - :method: Mobylette::Railtie - :message: has no descriptive comment - :type: IrresponsibleModule - - :file_path: lib/mobylette/version.rb - :code_smells: [] -:roodi: - :total: !!null - :problems: [] -:rcov: - lib/mobylette/helmet.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' # Mobylette::Helmet provides helper methods to help you when - testing your controllers' - :was_run: true - - :content: ! ' # for a mobile request.' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # You must include Mobylette::Helmet into your test case, in - the README there is more' - :was_run: false - - :content: ! ' # documentation about how to make this test wide.' - :was_run: false - - :content: ! ' module Helmet' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' autoload "Helpers", "mobylette/helmet/helpers"' - :was_run: true - - :content: ! ' autoload "Faker" , "mobylette/helmet/faker"' - :was_run: true - - :content: ! ' # Force the request for the user_agent' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Remember to add it BEFORE the request' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Example:' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # it "should render the mobile_device view on mobile request" - do' - :was_run: false - - :content: ! ' # force_mobile_request_agent("Android")' - :was_run: false - - :content: ! ' # get :index' - :was_run: false - - :content: ! ' # response.should render_template(:mobile_device)' - :was_run: false - - :content: ! ' # end' - :was_run: false - - :content: ! ' def force_mobile_request_agent(user_agent = "Android")' - :was_run: false - - :content: ! ' request.user_agent = user_agent' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' # Reset the user_aget to the default ("Rails Testing")' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Remember to add it BEFORE the request' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Example:' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # it "should render the normal_view view on mobile request" - do' - :was_run: false - - :content: ! ' # reset_test_request_agent' - :was_run: false - - :content: ! ' # get :index' - :was_run: false - - :content: ! ' # response.should render_template(:normal_view)' - :was_run: false - - :content: ! ' # end' - :was_run: false - - :content: ! ' def reset_test_request_agent' - :was_run: false - - :content: ! ' request.user_agent = "Rails Testing"' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 25 - :methods: - Mobylette#force_mobile_request_agent: 33.33333333333333 - Mobylette#reset_test_request_agent: 33.33333333333333 - lib/mobylette.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' module Controllers' - :was_run: true - - :content: ! ' autoload "RespondToMobileRequests", "mobylette/controllers/respond_to_mobile_requests"' - :was_run: true - - :content: ! ' autoload "Helpers" , "mobylette/controllers/helpers"' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' autoload "Helmet" , "mobylette/helmet"' - :was_run: false - - :content: ! ' require ''mobylette/railtie''' - :was_run: true - - :content: end - :was_run: true - - :content: require 'action_controller' - :was_run: false - - :content: Mime::Type.register_alias "text/html", :mobile - :was_run: true - :percent_run: 70 - :methods: {} - lib/mobylette/controllers/helpers.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' module Controllers' - :was_run: true - - :content: ! ' #' - :was_run: false - - :content: ! ' # Mobylette::Controllers::Helpers include few methods to' - :was_run: false - - :content: ! ' # include different css/js files for the mobile and for' - :was_run: false - - :content: ! ' # the normal version of your layout' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Personal note: I''m rethinking and I guess that, since you' - :was_run: false - - :content: ! ' # may have (and probably will) a different layout file for - the' - :was_run: false - - :content: ! ' # "normal" and mobile version, you probably wont use this at - all' - :was_run: false - - :content: ! ' module Helpers' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' # Adds a "_mobile" sulfix to the files you include (when - the request is mobile)' - :was_run: false - - :content: ! ' def mobylette_stylesheet_link_tag(*sources)' - :was_run: false - - :content: ! ' options = sources.extract_options!' - :was_run: true - - :content: ! ' if is_mobile_request?' - :was_run: true - - :content: ! ' stylesheet_link_tag(*sulfix_mobile_assets(sources, :css).insert(-1, - options))' - :was_run: true - - :content: ! ' else' - :was_run: true - - :content: ! ' stylesheet_link_tag(*sources.insert(-1, options))' - :was_run: false - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' # Adds a "_mobile" sulfix to the files you include (when - the request is mobile)' - :was_run: false - - :content: ! ' def mobylette_javascript_include_tag(*sources)' - :was_run: false - - :content: ! ' options = sources.extract_options!' - :was_run: true - - :content: ! ' if is_mobile_request?' - :was_run: true - - :content: ! ' javascript_include_tag(*sulfix_mobile_assets(sources, - :js).insert(-1, options))' - :was_run: true - - :content: ! ' else' - :was_run: true - - :content: ! ' javascript_include_tag(*sources.insert(-1, options))' - :was_run: false - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' private' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Anex the "_mobile" sulfix to each string in the array,' - :was_run: false - - :content: ! ' # before the .#{extension}, if it exists' - :was_run: false - - :content: ! ' def sulfix_mobile_assets(sources, extension)' - :was_run: false - - :content: ! ' sources.map do |source|' - :was_run: true - - :content: ! ' if source =~ /.#{extension}/' - :was_run: true - - :content: ! ' "#{source.split(/.#{extension}$/)[0]}_mobile.#{extension}"' - :was_run: true - - :content: ! ' else' - :was_run: true - - :content: ! ' "#{source}_mobile"' - :was_run: false - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 52 - :methods: - Mobylette#mobylette_stylesheet_link_tag: 25.0 - Mobylette#mobylette_javascript_include_tag: 25.0 - Mobylette#sulfix_mobile_assets: 22.22222222222222 - lib/mobylette/helmet/helpers.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' module Helmet' - :was_run: true - - :content: ! ' # This module is only for testing the view''s helpers of the - module' - :was_run: true - - :content: ! ' # it simulates the Helmet helpers and the controller methods' - :was_run: false - - :content: ! ' # that are necessary for the tests' - :was_run: false - - :content: ! ' module Helpers' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' included do' - :was_run: true - - :content: ! ' cattr_accessor :user_agent' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' def force_mobile_request_agent' - :was_run: false - - :content: ! ' insert_faker' - :was_run: true - - :content: ! ' ActionController::Base.is_mobile_request = true' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' def reset_test_request_agent' - :was_run: false - - :content: ! ' insert_faker' - :was_run: true - - :content: ! ' ActionController::Base.is_mobile_request = false' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' private' - :was_run: false - - :content: ! ' def insert_faker' - :was_run: false - - :content: ! ' return if ActionController::Base.included_modules.include?(Mobylette::Helmet::Faker)' - :was_run: true - - :content: ! ' ActionController::Base.send(:include, Mobylette::Helmet::Faker)' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 69 - :methods: - Mobylette#force_mobile_request_agent: 25.0 - Mobylette#reset_test_request_agent: 25.0 - Mobylette#insert_faker: 25.0 - lib/mobylette/controllers/respond_to_mobile_requests.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' module Controllers' - :was_run: true - - :content: ! ' # Mobylette::Controllers::RespondToMobileRequests includes - the respond_to_mobile_requests' - :was_run: false - - :content: ! ' # to your ActionController::Base.' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # The respond_to_mobile_requests method enables the controller - mobile handling' - :was_run: false - - :content: ! ' module RespondToMobileRequests' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' included do' - :was_run: true - - :content: ! ' helper_method :is_mobile_request?' - :was_run: true - - :content: ! ' # List of mobile agents, from mobile_fu (https://github.com/brendanlim/mobile-fu)' - :was_run: true - - :content: ! ' MOBILE_USER_AGENTS = ''palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|'' - +' - :was_run: true - - :content: ! ' ''audiovox|motorola|samsung|telit|upg1|windows - ce|ucweb|astel|plucker|'' +' - :was_run: true - - :content: ! ' ''x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|'' - +' - :was_run: true - - :content: ! ' ''pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|'' - +' - :was_run: true - - :content: ! ' ''webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|'' +' - :was_run: true - - :content: ! ' ''mobile''' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' module ClassMethods' - :was_run: false - - :content: ! ' # This method enables the controller do handle mobile requests' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # You must add this to every controller you want to respond - differently to mobile devices,' - :was_run: false - - :content: ! ' # or make it application wide calling it from the ApplicationController' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # Options:' - :was_run: false - - :content: ! ' # * :fall_back => :html' - :was_run: false - - :content: ! ' # You may pass a fall_back option to the method, it - will force the render' - :was_run: false - - :content: ! ' # to look for that other format, in case there is not - a .mobile file for the view.' - :was_run: false - - :content: ! ' # By default, it will fall back to the format of the - original request.' - :was_run: false - - :content: ! ' # If you don''t want fall back at all, pass :fall_back - => false' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' def respond_to_mobile_requests(options = {})' - :was_run: false - - :content: ! ' return if self.included_modules.include?(Mobylette::Controllers::RespondToMobileRequestsMethods)' - :was_run: true - - :content: ! ' cattr_accessor :fall_back_format' - :was_run: false - - :content: ! ' self.fall_back_format = options[:fall_back]' - :was_run: true - - :content: ! ' self.send(:include, Mobylette::Controllers::RespondToMobileRequestsMethods)' - :was_run: false - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' module InstanceMethods' - :was_run: false - - :content: ! ' private' - :was_run: false - - :content: ! ' # helper method to check if the current request if from - a mobile device or not' - :was_run: false - - :content: ! ' def is_mobile_request?' - :was_run: false - - :content: ! ' return true if (request.format.to_s == "mobile") or (params[:format] - == "mobile")' - :was_run: true - - :content: ! ' request.user_agent.to_s.downcase =~ /#{MOBILE_USER_AGENTS}/' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' # RespondToMobileRequestsMethods is included by respond_to_mobile_requests' - :was_run: false - - :content: ! ' #' - :was_run: false - - :content: ! ' # This will check if the request is from a mobile device and - change' - :was_run: false - - :content: ! ' # the request format to :mobile' - :was_run: false - - :content: ! ' module RespondToMobileRequestsMethods' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' included do' - :was_run: true - - :content: ! ' before_filter :handle_mobile' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' module InstanceMethods' - :was_run: false - - :content: ! ' private' - :was_run: true - - :content: ! ' # Changes the request.form to :mobile, when the request - is from' - :was_run: false - - :content: ! ' # a mobile device' - :was_run: false - - :content: ! ' def handle_mobile' - :was_run: false - - :content: ! ' if is_mobile_request?' - :was_run: true - - :content: ! ' original_format = request.format.to_sym' - :was_run: true - - :content: ! ' request.format = :mobile' - :was_run: true - - :content: ! ' if self.fall_back_format != false' - :was_run: true - - :content: ! ' request.formats << Mime::Type.new((self.fall_back_format - if self.fall_back_format) || original_format)' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 52 - :methods: - Mobylette#respond_to_mobile_requests: 50.0 - Mobylette#is_mobile_request?: 25.0 - Mobylette#handle_mobile: 11.11111111111111 - lib/mobylette/helmet/faker.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' module Helmet' - :was_run: true - - :content: ! ' # Forces the helper to think that all requests come' - :was_run: false - - :content: ! ' # from a mobile device' - :was_run: false - - :content: ! ' module Faker' - :was_run: false - - :content: ! ' extend ActiveSupport::Concern' - :was_run: true - - :content: ! ' included do' - :was_run: true - - :content: ! ' cattr_accessor :is_mobile_request' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' def is_mobile_request?' - :was_run: false - - :content: ! ' is_mobile_request' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 67 - :methods: - Mobylette#is_mobile_request?: 33.33333333333333 - lib/mobylette/railtie.rb: - :lines: - - :content: module Mobylette - :was_run: false - - :content: ! ' class Railtie < ::Rails::Railtie' - :was_run: true - - :content: ! ' initializer :mobylette do' - :was_run: true - - :content: ! ' ActiveSupport.on_load(:action_controller) do' - :was_run: true - - :content: ! ' ::ActionController::Base.send(:include, Mobylette::Controllers::RespondToMobileRequests)' - :was_run: true - - :content: ! ' ::ActionController::Base.helper Mobylette::Controllers::Helpers' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: ! ' end' - :was_run: true - - :content: end - :was_run: true - :percent_run: 90 - :methods: {} - :global_percent_run: 52.7 -:hotspots: - :files: - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb - class_name: !!null - method_name: !!null - hash: 4031988555471547402 - :details: - :churn: detected high level of churn (changed 5 times) - :rcov: average uncovered code is 33.3% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/faker.rb - class_name: !!null - method_name: !!null - hash: -1320828597441085005 - :details: - :rcov: uncovered code is 33.3% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: !!null - method_name: !!null - hash: 117964027637858853 - :details: - :reek: found 3 code smells - :churn: detected high level of churn (changed 16 times) - :rcov: average uncovered code is 28.7% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb - class_name: !!null - method_name: !!null - hash: -2589091859213638349 - :details: - :reek: found 1 code smells - :churn: detected high level of churn (changed 3 times) - :rcov: average uncovered code is 25.0% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: !!null - method_name: !!null - hash: -2010976377942857437 - :details: - :reek: found 3 code smells - :churn: detected high level of churn (changed 10 times) - :rcov: average uncovered code is 24.1% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb:76 - class_name: !!null - method_name: !!null - hash: -2673405952775493842 - :details: - :flog: complexity is 25.2 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb:52 - class_name: !!null - method_name: !!null - hash: 2583861898095884453 - :details: - :flog: complexity is 19.3 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb:26 - class_name: !!null - method_name: !!null - hash: 1295188944676677225 - :details: - :flog: complexity is 9.8 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb:16 - class_name: !!null - method_name: !!null - hash: 4497399214937041911 - :details: - :flog: complexity is 9.8 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb:37 - class_name: !!null - method_name: !!null - hash: -1357083643028374538 - :details: - :flog: complexity is 9.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/railtie.rb:8 - class_name: !!null - method_name: !!null - hash: -1204908533049299000 - :details: - :flog: complexity is 6.9 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb:26 - class_name: !!null - method_name: !!null - hash: -4133621839551933449 - :details: - :flog: complexity is 6.3 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb:40 - class_name: !!null - method_name: !!null - hash: 3880486540989219889 - :details: - :flog: complexity is 5.1 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb:23 - class_name: !!null - method_name: !!null - hash: 3220201136002057639 - :details: - :flog: complexity is 2.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb:19 - class_name: !!null - method_name: !!null - hash: -3938546682885686166 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb:14 - class_name: !!null - method_name: !!null - hash: -2523664642780364557 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb:38 - class_name: !!null - method_name: !!null - hash: 3309556124977960288 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/faker.rb:13 - class_name: !!null - method_name: !!null - hash: -1974011112281426555 - :details: - :flog: complexity is 1.2 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette.rb - class_name: !!null - method_name: !!null - hash: -1263139811812968281 - :details: - :churn: detected high level of churn (changed 8 times) - - :location: !ruby/object:MetricFu::Location - file_path: Gemfile - class_name: !!null - method_name: !!null - hash: -2516335185424333780 - :details: - :churn: detected high level of churn (changed 11 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/spec_helper.rb - class_name: !!null - method_name: !!null - hash: -3359517023979849187 - :details: - :churn: detected high level of churn (changed 10 times) - - :location: !ruby/object:MetricFu::Location - file_path: README.rdoc - class_name: !!null - method_name: !!null - hash: -1327748734090572649 - :details: - :churn: detected high level of churn (changed 16 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/config/routes.rb - class_name: !!null - method_name: !!null - hash: -3557814377825911303 - :details: - :churn: detected high level of churn (changed 8 times) - - :location: !ruby/object:MetricFu::Location - file_path: Gemfile.lock - class_name: !!null - method_name: !!null - hash: 1104042346890023718 - :details: - :churn: detected high level of churn (changed 12 times) - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/engine.rb - class_name: !!null - method_name: !!null - hash: 3228638806505301429 - :details: - :churn: detected high level of churn (changed 5 times) - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/railtie.rb - class_name: !!null - method_name: !!null - hash: 1255688775325308433 - :details: - :reek: found 1 code smells - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: .gitignore - class_name: !!null - method_name: !!null - hash: -4504650009409780781 - :details: - :churn: detected high level of churn (changed 4 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/controllers/application_controller_spec.rb - class_name: !!null - method_name: !!null - hash: 2964566127799032686 - :details: - :churn: detected high level of churn (changed 4 times) - - :location: !ruby/object:MetricFu::Location - file_path: TODO.rdoc - class_name: !!null - method_name: !!null - hash: 2669425395196239458 - :details: - :churn: detected high level of churn (changed 4 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/app/controllers/home_controller.rb - class_name: !!null - method_name: !!null - hash: -1709711208192373868 - :details: - :churn: detected high level of churn (changed 4 times) - - :location: !ruby/object:MetricFu::Location - file_path: CHANGELOG.rdoc - class_name: !!null - method_name: !!null - hash: -2039361998317327931 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/version.rb - class_name: !!null - method_name: !!null - hash: -2206831346799711886 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/controllers/desktop_only_controller_spec.rb - class_name: !!null - method_name: !!null - hash: -1302719736919663957 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/app/controllers/application_controller.rb - class_name: !!null - method_name: !!null - hash: -268717846351251623 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/controllers/actioncontroller_base_spec.rb - class_name: !!null - method_name: !!null - hash: -4151852866560622810 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: config/initializers/mobile_mime_types.rb - class_name: !!null - method_name: !!null - hash: 1861836418555359750 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: mobylette.gemspec - class_name: !!null - method_name: !!null - hash: -1403293196412339159 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/helpers/mobylette_helpers_spec.rb - class_name: !!null - method_name: !!null - hash: 2357911946787872181 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/app/views/layouts/application.html.erb - class_name: !!null - method_name: !!null - hash: 9231446674810798 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/app/views/layouts/application.mobile.erb - class_name: !!null - method_name: !!null - hash: -1312334453419488553 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/dummy/app/views/home/index.html.erb - class_name: !!null - method_name: !!null - hash: 3808675372654851053 - :details: - :churn: detected high level of churn (changed 3 times) - - :location: !ruby/object:MetricFu::Location - file_path: spec/controllers/home_controller_spec.rb - class_name: !!null - method_name: !!null - hash: -643433951259628329 - :details: - :churn: detected high level of churn (changed 8 times) - :classes: - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Mobylette - method_name: !!null - hash: 1127078764280111091 - :details: - :flog: complexity is 2.4 - :rcov: average uncovered code is 27.8% - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: RespondToMobileRequests - method_name: !!null - hash: 1957992759113255412 - :details: - :flog: complexity is 14.1 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: InstanceMethods - method_name: !!null - hash: 1703103870811795206 - :details: - :reek: found 3 code smells - :flog: average complexity is 11.8 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb:37 - class_name: ClassMethods - method_name: !!null - hash: 3050132251966709929 - :details: - :flog: complexity is 9.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/railtie.rb:8 - class_name: initializer - method_name: !!null - hash: -2298043145253401330 - :details: - :flog: complexity is 6.9 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: Helpers - method_name: !!null - hash: -3020320142483559131 - :details: - :reek: found 4 code smells - :flog: average complexity is 5.4 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: RespondToMobileRequestsMethods - method_name: !!null - hash: 720454466420826181 - :details: - :flog: complexity is 5.0 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Helmet - method_name: !!null - hash: 1035421190592118804 - :details: - :flog: average complexity is 2.9 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Faker - method_name: !!null - hash: -2785909516004027923 - :details: - :flog: average complexity is 2.9 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Controllers - method_name: !!null - hash: -1839539121938893154 - :details: - :flog: complexity is 2.6 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: main - method_name: !!null - hash: 841665147017659477 - :details: - :flog: complexity is 2.2 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/railtie.rb - class_name: Railtie - method_name: !!null - hash: -1815576609427783202 - :details: - :reek: found 1 code smells - :methods: - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: Mobylette - method_name: Mobylette#respond_to_mobile_requests - simple_method_name: ! '#respond_to_mobile_requests' - hash: 435875292522611010 - :details: - :rcov: uncovered code is 50.0% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb - class_name: Mobylette - method_name: Mobylette#reset_test_request_agent - simple_method_name: ! '#reset_test_request_agent' - hash: 30496347127118222 - :details: - :rcov: average uncovered code is 29.2% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb - class_name: Mobylette - method_name: Mobylette#force_mobile_request_agent - simple_method_name: ! '#force_mobile_request_agent' - hash: -661758521947166839 - :details: - :rcov: average uncovered code is 29.2% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: Mobylette - method_name: Mobylette#is_mobile_request? - simple_method_name: ! '#is_mobile_request?' - hash: -250871125129175485 - :details: - :rcov: average uncovered code is 29.2% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: InstanceMethods - method_name: InstanceMethods#handle_mobile - simple_method_name: ! '#handle_mobile' - hash: -161619565808645258 - :details: - :reek: found 2 code smells - :flog: complexity is 25.2 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: Mobylette - method_name: Mobylette#mobylette_javascript_include_tag - simple_method_name: ! '#mobylette_javascript_include_tag' - hash: 460418927741046551 - :details: - :rcov: uncovered code is 25.0% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb - class_name: Mobylette - method_name: Mobylette#insert_faker - simple_method_name: ! '#insert_faker' - hash: 202865185818091983 - :details: - :rcov: uncovered code is 25.0% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: Mobylette - method_name: Mobylette#mobylette_stylesheet_link_tag - simple_method_name: ! '#mobylette_stylesheet_link_tag' - hash: -139747529402004122 - :details: - :rcov: uncovered code is 25.0% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: Mobylette - method_name: Mobylette#sulfix_mobile_assets - simple_method_name: ! '#sulfix_mobile_assets' - hash: 3831883063641737300 - :details: - :rcov: uncovered code is 22.2% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: InstanceMethods - method_name: InstanceMethods#is_mobile_request? - simple_method_name: ! '#is_mobile_request?' - hash: 3859946802256305466 - :details: - :reek: found 1 code smells - :flog: complexity is 19.3 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: RespondToMobileRequests - method_name: RespondToMobileRequests#none - simple_method_name: ! '#none' - hash: -1692835556681480748 - :details: - :flog: complexity is 14.1 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb - class_name: Mobylette - method_name: Mobylette#handle_mobile - simple_method_name: ! '#handle_mobile' - hash: 3407221860435910351 - :details: - :rcov: uncovered code is 11.1% - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb:26 - class_name: Helpers - method_name: Helpers#mobylette_javascript_include_tag - simple_method_name: ! '#mobylette_javascript_include_tag' - hash: -1009369629486017935 - :details: - :flog: complexity is 9.8 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb:16 - class_name: Helpers - method_name: Helpers#mobylette_stylesheet_link_tag - simple_method_name: ! '#mobylette_stylesheet_link_tag' - hash: 2592345737306786878 - :details: - :flog: complexity is 9.8 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/respond_to_mobile_requests.rb:37 - class_name: ClassMethods - method_name: ClassMethods#respond_to_mobile_requests - simple_method_name: ! '#respond_to_mobile_requests' - hash: 3402835281330347563 - :details: - :flog: complexity is 9.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/railtie.rb:8 - class_name: initializer - method_name: initializer#mobylette - simple_method_name: ! '#mobylette' - hash: 758994720931463807 - :details: - :flog: complexity is 6.9 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb - class_name: Helpers - method_name: Helpers#insert_faker - simple_method_name: ! '#insert_faker' - hash: -1032457257041059147 - :details: - :reek: found 1 code smells - :flog: complexity is 6.3 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/controllers/helpers.rb - class_name: Helpers - method_name: Helpers#sulfix_mobile_assets - simple_method_name: ! '#sulfix_mobile_assets' - hash: 3610269827339442079 - :details: - :reek: found 3 code smells - :flog: complexity is 5.1 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: RespondToMobileRequestsMethods - method_name: RespondToMobileRequestsMethods#none - simple_method_name: ! '#none' - hash: 3907795019904669680 - :details: - :flog: complexity is 5.0 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Faker - method_name: Faker#none - simple_method_name: ! '#none' - hash: 1638109036316188838 - :details: - :flog: complexity is 4.6 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Helpers - method_name: Helpers#none - simple_method_name: ! '#none' - hash: 4041480011242348926 - :details: - :flog: average complexity is 4.5 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Helmet - method_name: Helmet#none - simple_method_name: ! '#none' - hash: 1371954594264296735 - :details: - :flog: complexity is 4.4 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb:23 - class_name: Helmet - method_name: Helmet#force_mobile_request_agent - simple_method_name: ! '#force_mobile_request_agent' - hash: 404959666978006334 - :details: - :flog: complexity is 2.7 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Controllers - method_name: Controllers#none - simple_method_name: ! '#none' - hash: -4520928572902011146 - :details: - :flog: complexity is 2.6 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: Mobylette - method_name: Mobylette#none - simple_method_name: ! '#none' - hash: -2321303308616815140 - :details: - :flog: complexity is 2.4 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: main - method_name: main#none - simple_method_name: ! '#none' - hash: 4057060770261915198 - :details: - :flog: complexity is 2.2 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet.rb:38 - class_name: Helmet - method_name: Helmet#reset_test_request_agent - simple_method_name: ! '#reset_test_request_agent' - hash: 3459245677518319831 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb:14 - class_name: Helpers - method_name: Helpers#force_mobile_request_agent - simple_method_name: ! '#force_mobile_request_agent' - hash: 1227887528266058019 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/helpers.rb:19 - class_name: Helpers - method_name: Helpers#reset_test_request_agent - simple_method_name: ! '#reset_test_request_agent' - hash: 3995456109607318102 - :details: - :flog: complexity is 1.7 - - :location: !ruby/object:MetricFu::Location - file_path: !!null - class_name: InstanceMethods - method_name: InstanceMethods#none - simple_method_name: ! '#none' - hash: -2233112655950772831 - :details: - :flog: average complexity is 1.3 - - :location: !ruby/object:MetricFu::Location - file_path: lib/mobylette/helmet/faker.rb:13 - class_name: Faker - method_name: Faker#is_mobile_request? - simple_method_name: ! '#is_mobile_request?' - hash: 1016741441638077673 - :details: - :flog: complexity is 1.2 diff --git a/v1.0.0/metric_fu/scratch/rcov/rcov.txt b/v1.0.0/metric_fu/scratch/rcov/rcov.txt deleted file mode 100644 index c61e7ab..0000000 --- a/v1.0.0/metric_fu/scratch/rcov/rcov.txt +++ /dev/null @@ -1,292 +0,0 @@ -** WARNING: Ruby 1.9 Support is experimental at best. Don't expect correct results! ** -Loaded suite /Users/tscolari/.rvm/gems/ruby-1.9.2-p290/bin/rcov -Started - -Finished in 0.002593 seconds. - -0 tests, 0 assertions, 0 failures, 0 errors, 0 skips - -Test run options: --seed 57968 -....................................... - -Finished in 0.88442 seconds -39 examples, 0 failures -================================================================================ -lib/mobylette/helmet.rb -================================================================================ -!! module Mobylette - # Mobylette::Helmet provides helper methods to help you when testing your controllers -!! # for a mobile request. -!! # -!! # You must include Mobylette::Helmet into your test case, in the README there is more -!! # documentation about how to make this test wide. -!! module Helmet - extend ActiveSupport::Concern - autoload "Helpers", "mobylette/helmet/helpers" - autoload "Faker" , "mobylette/helmet/faker" - -!! # Force the request for the user_agent -!! # -!! # Remember to add it BEFORE the request -!! # -!! # Example: -!! # -!! # it "should render the mobile_device view on mobile request" do -!! # force_mobile_request_agent("Android") -!! # get :index -!! # response.should render_template(:mobile_device) -!! # end -!! def force_mobile_request_agent(user_agent = "Android") - request.user_agent = user_agent - end - -!! # Reset the user_aget to the default ("Rails Testing") -!! # -!! # Remember to add it BEFORE the request -!! # -!! # Example: -!! # -!! # it "should render the normal_view view on mobile request" do -!! # reset_test_request_agent -!! # get :index -!! # response.should render_template(:normal_view) -!! # end -!! def reset_test_request_agent - request.user_agent = "Rails Testing" - end - - end - end -================================================================================ -lib/mobylette.rb -================================================================================ -!! module Mobylette - module Controllers - autoload "RespondToMobileRequests", "mobylette/controllers/respond_to_mobile_requests" - autoload "Helpers" , "mobylette/controllers/helpers" - end - -!! autoload "Helmet" , "mobylette/helmet" - require 'mobylette/railtie' - end - -!! require 'action_controller' - Mime::Type.register_alias "text/html", :mobile -================================================================================ -lib/mobylette/controllers/helpers.rb -================================================================================ -!! module Mobylette - module Controllers - -!! # -!! # Mobylette::Controllers::Helpers include few methods to -!! # include different css/js files for the mobile and for -!! # the normal version of your layout -!! # -!! # Personal note: I'm rethinking and I guess that, since you -!! # may have (and probably will) a different layout file for the -!! # "normal" and mobile version, you probably wont use this at all -!! module Helpers - extend ActiveSupport::Concern - -!! # Adds a "_mobile" sulfix to the files you include (when the request is mobile) -!! def mobylette_stylesheet_link_tag(*sources) - options = sources.extract_options! - if is_mobile_request? - stylesheet_link_tag(*sulfix_mobile_assets(sources, :css).insert(-1, options)) - else -!! stylesheet_link_tag(*sources.insert(-1, options)) - end - end - -!! # Adds a "_mobile" sulfix to the files you include (when the request is mobile) -!! def mobylette_javascript_include_tag(*sources) - options = sources.extract_options! - if is_mobile_request? - javascript_include_tag(*sulfix_mobile_assets(sources, :js).insert(-1, options)) - else -!! javascript_include_tag(*sources.insert(-1, options)) - end - end - -!! private - -!! # -!! # Anex the "_mobile" sulfix to each string in the array, -!! # before the .#{extension}, if it exists -!! def sulfix_mobile_assets(sources, extension) - sources.map do |source| - if source =~ /.#{extension}/ - "#{source.split(/.#{extension}$/)[0]}_mobile.#{extension}" - else -!! "#{source}_mobile" - end - end - end - end - - end - end -================================================================================ -lib/mobylette/helmet/helpers.rb -================================================================================ -!! module Mobylette - module Helmet - # This module is only for testing the view's helpers of the module -!! # it simulates the Helmet helpers and the controller methods -!! # that are necessary for the tests -!! module Helpers - extend ActiveSupport::Concern - - included do - cattr_accessor :user_agent - end -!! -!! -!! def force_mobile_request_agent - insert_faker - ActionController::Base.is_mobile_request = true - end - -!! def reset_test_request_agent - insert_faker - ActionController::Base.is_mobile_request = false - end - -!! private - -!! def insert_faker - return if ActionController::Base.included_modules.include?(Mobylette::Helmet::Faker) - ActionController::Base.send(:include, Mobylette::Helmet::Faker) - end - - - end - end - end -================================================================================ -lib/mobylette/controllers/respond_to_mobile_requests.rb -================================================================================ -!! module Mobylette - module Controllers - -!! # Mobylette::Controllers::RespondToMobileRequests includes the respond_to_mobile_requests -!! # to your ActionController::Base. -!! # -!! # The respond_to_mobile_requests method enables the controller mobile handling -!! module RespondToMobileRequests - extend ActiveSupport::Concern - - included do - helper_method :is_mobile_request? - - # List of mobile agents, from mobile_fu (https://github.com/brendanlim/mobile-fu) - MOBILE_USER_AGENTS = 'palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|' + - 'audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|' + - 'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' + - 'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' + - 'webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|' + - 'mobile' - end -!! -!! module ClassMethods - -!! # This method enables the controller do handle mobile requests -!! # -!! # You must add this to every controller you want to respond differently to mobile devices, -!! # or make it application wide calling it from the ApplicationController -!! # -!! # Options: -!! # * :fall_back => :html -!! # You may pass a fall_back option to the method, it will force the render -!! # to look for that other format, in case there is not a .mobile file for the view. -!! # By default, it will fall back to the format of the original request. -!! # If you don't want fall back at all, pass :fall_back => false -!! # -!! def respond_to_mobile_requests(options = {}) - return if self.included_modules.include?(Mobylette::Controllers::RespondToMobileRequestsMethods) - -!! cattr_accessor :fall_back_format - self.fall_back_format = options[:fall_back] - -!! self.send(:include, Mobylette::Controllers::RespondToMobileRequestsMethods) - end - end - -!! module InstanceMethods - -!! private - -!! # helper method to check if the current request if from a mobile device or not -!! def is_mobile_request? - return true if (request.format.to_s == "mobile") or (params[:format] == "mobile") - request.user_agent.to_s.downcase =~ /#{MOBILE_USER_AGENTS}/ - end - end - - end - -!! # RespondToMobileRequestsMethods is included by respond_to_mobile_requests -!! # -!! # This will check if the request is from a mobile device and change -!! # the request format to :mobile -!! module RespondToMobileRequestsMethods - extend ActiveSupport::Concern - - included do - before_filter :handle_mobile - end -!! -!! module InstanceMethods - private - -!! # Changes the request.form to :mobile, when the request is from -!! # a mobile device -!! def handle_mobile - if is_mobile_request? - original_format = request.format.to_sym - request.format = :mobile - if self.fall_back_format != false - request.formats << Mime::Type.new((self.fall_back_format if self.fall_back_format) || original_format) - end - end - end - end - end - end - end -================================================================================ -lib/mobylette/helmet/faker.rb -================================================================================ -!! module Mobylette - module Helmet - -!! # Forces the helper to think that all requests come -!! # from a mobile device -!! module Faker - extend ActiveSupport::Concern - - included do - cattr_accessor :is_mobile_request - end -!! -!! def is_mobile_request? - is_mobile_request - end - - end - end - end -================================================================================ -lib/mobylette/railtie.rb -================================================================================ -!! module Mobylette - class Railtie < ::Rails::Railtie - initializer :mobylette do - ActiveSupport.on_load(:action_controller) do - ::ActionController::Base.send(:include, Mobylette::Controllers::RespondToMobileRequests) - ::ActionController::Base.helper Mobylette::Controllers::Helpers - end - end - end - end diff --git a/v1.1.0/index.html b/v1.1.0/index.html index 8871156..f5edb09 100644 --- a/v1.1.0/index.html +++ b/v1.1.0/index.html @@ -23,7 +23,6 @@

    Mobylette

    This is the API documentation for 'Mobylette'.

    -

    metric_fu

    diff --git a/v1.1.0/metric_fu/output/bluff-min.js b/v1.1.0/metric_fu/output/bluff-min.js deleted file mode 100644 index 3a80df0..0000000 --- a/v1.1.0/metric_fu/output/bluff-min.js +++ /dev/null @@ -1 +0,0 @@ -Bluff={VERSION:'0.3.6',array:function(c){if(c.length===undefined)return[c];var d=[],f=c.length;while(f--)d[f]=c[f];return d},array_new:function(c,d){var f=[];while(c--)f.push(d);return f},each:function(c,d,f){for(var g=0,h=c.length;gthis._5)?g.length:this._5;Bluff.each(g,function(c,d){if(c===undefined)return;if(this.maximum_value===null&&this.minimum_value===null)this.maximum_value=this.minimum_value=c;this.maximum_value=this._1f(c)?c:this.maximum_value;if(this.maximum_value>=0)this._a=true;this.minimum_value=this._1A(c)?c:this.minimum_value;if(this.minimum_value<0)this._a=true},this)},draw:function(){if(this.stacked)this._1B();this._1C();this._u(function(){this._0.rectangle(this.left_margin,this.top_margin,this._d-this.right_margin,this._L-this.bottom_margin);this._0.rectangle(this._1,this._7,this._l,this._g)})},clear:function(){this._X()},_1C:function(){if(!this._a)return this._1D();this._13();this._1E();if(this.sort)this._1F();this._1G();this._M();this._1H();this._1I()},_13:function(g){if(this._9===null||g===true){this._9=[];if(!this._a)return;this._1g();Bluff.each(this._2,function(d){var f=[];Bluff.each(d[this.klass.DATA_VALUES_INDEX],function(c){if(c===null||c===undefined)f.push(null);else f.push((c-this.minimum_value)/this._i)},this);this._9.push([d[this.klass.DATA_LABEL_INDEX],f,d[this.klass.DATA_COLOR_INDEX]])},this)}},_1g:function(){this._i=this.maximum_value-this.minimum_value;this._i=this._i>0?this._i:1;this._1h=100/Math.pow(10,Math.round(Math.LOG10E*Math.log(this._i)))},_1E:function(){this._N=this.hide_line_markers?0:this._D(this.marker_font_size);this._1i=this.hide_title?0:this._D(this.title_font_size);this._1j=this.hide_legend?0:this._D(this.legend_font_size);var c,d,f,g,h,i,j;if(this.hide_line_markers){this._1=this.left_margin;this._14=this.right_margin;this._1k=this.bottom_margin}else{d=0;if(this.has_left_labels){c='';for(j in this.labels){c=c.length>this.labels[j].length?c:this.labels[j]}d=this._O(this.marker_font_size,c)*1.25}else{d=this._O(this.marker_font_size,this._15(this.maximum_value))}f=this.hide_line_numbers&&!this.has_left_labels?0.0:d+this.klass.LABEL_MARGIN*2;this._1=this.left_margin+f+(this.y_axis_label===null?0.0:this._N+this.klass.LABEL_MARGIN*2);g=-Infinity;for(j in this.labels)g=g>Number(j)?g:Number(j);g=Math.round(g);h=(g>=(this._5-1)&&this.center_labels_over_point)?this._O(this.marker_font_size,this.labels[g])/2:0;this._14=this.right_margin+h;this._1k=this.bottom_margin+this._N+this.klass.LABEL_MARGIN}this._l=this._d-this._14;this._6=this._d-this._1-this._14;this._7=this.top_margin+(this.hide_title?this.title_margin:this._1i+this.title_margin)+(this.hide_legend?this.legend_margin:this._1j+this.legend_margin);i=(this.x_axis_label===null)?0.0:this._N+this.klass.LABEL_MARGIN;this._g=this._L-this._1k-i;this._3=this._g-this._7},_1H:function(){if(this.x_axis_label){var c=this._g+this.klass.LABEL_MARGIN*2+this._N;this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.pointsize=this._e(this.marker_font_size);this._0.gravity='north';this._0.annotate_scaled(this._d,1.0,0.0,c,this.x_axis_label,this._b);this._u(function(){this._0.line(0.0,c,this._d,c)})}},_M:function(){if(this.hide_line_markers)return;if(this.y_axis_increment===null){if(this.marker_count===null){Bluff.each([3,4,5,6,7],function(c){if(!this.marker_count&&this._i%c===0)this.marker_count=c},this);this.marker_count=this.marker_count||4}this._16=(this._i>0)?this._17(this._i/this.marker_count):1}else{this.maximum_value=Math.max(Math.ceil(this.maximum_value),this.y_axis_increment);this.minimum_value=Math.floor(this.minimum_value);this._1g();this._13(true);this.marker_count=Math.round(this._i/this.y_axis_increment);this._16=this.y_axis_increment}this._1J=this._3/(this._i/this._16);var d,f,g,h;for(d=0,f=this.marker_count;d<=f;d++){g=this._7+this._3-d*this._1J;this._0.stroke=this.marker_color;this._0.stroke_width=1;this._0.line(this._1,g,this._l,g);h=d*this._16+this.minimum_value;if(!this.hide_line_numbers){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.font_weight='normal';this._0.stroke='transparent';this._0.pointsize=this._e(this.marker_font_size);this._0.gravity='east';this._0.annotate_scaled(this._1-this.klass.LABEL_MARGIN,1.0,0.0,g,this._15(h),this._b)}}},_1l:function(c){return(this._d-c)/2},_1G:function(){if(this.hide_legend)return;this._P=Bluff.map(this._2,function(c){return c[this.klass.DATA_LABEL_INDEX]},this);var i=this.legend_box_size;if(this.font)this._0.font=this.font;this._0.pointsize=this.legend_font_size;var j=[[]];Bluff.each(this._P,function(c){var d=j.length-1;var f=this._0.get_type_metrics(c);var g=f.width+i*2.7;j[d].push(g);if(Bluff.sum(j[d])>(this._d*0.9))j.push([j[d].pop()])},this);var k=this._1l(Bluff.sum(j[0]));var l=this.hide_title?this.top_margin+this.title_margin:this.top_margin+this.title_margin+this._1i;this._u(function(){this._0.stroke_width=1;this._0.line(0,l,this._d,l)});Bluff.each(this._P,function(c,d){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._e(this.legend_font_size);this._0.stroke='transparent';this._0.font_weight='normal';this._0.gravity='west';this._0.annotate_scaled(this._d,1.0,k+(i*1.7),l,c,this._b);this._0.stroke='transparent';this._0.fill=this._2[d][this.klass.DATA_COLOR_INDEX];this._0.rectangle(k,l-i/2.0,k+i,l+i/2.0);this._0.pointsize=this.legend_font_size;var f=this._0.get_type_metrics(c);var g=f.width+(i*2.7),h;j[0].shift();if(j[0].length==0){this._u(function(){this._0.line(0.0,l,this._d,l)});j.shift();if(j.length>0)k=this._1l(Bluff.sum(j[0]));h=Math.max(this._1j,i)+this.legend_margin;if(j.length>0){l+=h;this._7+=h;this._3=this._g-this._7}}else{k+=g}},this);this._m=0},_1I:function(){if(this.hide_title||!this.title)return;this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._e(this.title_font_size);this._0.font_weight='bold';this._0.gravity='north';this._0.annotate_scaled(this._d,1.0,0,this.top_margin,this.title,this._b)},_c:function(c,d){if(this.hide_line_markers)return;var f;if(this.labels[d]&&!this._q[d]){f=this._g+this.klass.LABEL_MARGIN;this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._e(this.marker_font_size);this._0.gravity='north';this._0.annotate_scaled(1.0,1.0,c,f,this.labels[d],this._b);this._q[d]=true;this._u(function(){this._0.stroke_width=1;this._0.line(0.0,f,this._d,f)})}},_E:function(c,d,f,g,h,i,j){if(!this.tooltips)return;this._0.tooltip(c,d,f,g,h,i,j)},_1D:function(){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._e(80);this._0.gravity='center';this._0.annotate_scaled(this._d,this._L/2,0,10,this.no_data_message,this._b)},_X:function(){var c=this._k.background_colors;switch(true){case c instanceof Array:this._1K.apply(this,c);break;case typeof c==='string':this._1L(c);break;default:this._1M(this._k.background_image);break}},_1L:function(c){this._0.render_solid_background(this._j,this._y,c)},_1K:function(c,d){this._0.render_gradiated_background(this._j,this._y,c,d)},_1M:function(c){},_1e:function(){this._m=0;this._q={};this._k={};this._0.scale(this._b,this._b)},_2a:function(c){return this._b*c},_e:function(c){var d=c*this._b;return d},_Q:function(c,d){return(c>d)?d:c},_1f:function(c,d){return c>this.maximum_value},_1A:function(c,d){return c100){c/=10;d*=10}return Math.floor(c)*d},_1F:function(){var f=this._1N,g=this.klass.DATA_VALUES_INDEX;this._9.sort(function(c,d){return f(d[g])-f(c[g])});this._2.sort(function(c,d){return f(d[g])-f(c[g])})},_1N:function(d){var f=0;Bluff.each(d,function(c){f+=(c||0)});return f},_1B:function(){var g=[],h=this._5;while(h--)g[h]=0;Bluff.each(this._2,function(f){Bluff.each(f[this.klass.DATA_VALUES_INDEX],function(c,d){g[d]+=c},this);f[this.klass.DATA_VALUES_INDEX]=Bluff.array(g)},this)},_u:function(c){if(this.klass.DEBUG){this._0.fill='transparent';this._0.stroke='turquoise';c.call(this)}},_1z:function(){if(this._m0&&k>0){i.push(f);i.push(g)}else{i.push(this._1);i.push(this._g-1);i.push(f);i.push(g)}this._c(f,d);j=f;k=g},this);i.push(this._l);i.push(this._g-1);i.push(this._1);i.push(this._g-1);this._0.fill=h[this.klass.DATA_COLOR_INDEX];this._0.polyline(i)},this)}});Bluff.BarConversion=new JS.Class({mode:null,zero:null,graph_top:null,graph_height:null,minimum_value:null,spread:null,getLeftYRightYscaled:function(c,d){var f;switch(this.mode){case 1:d[0]=this.graph_top+this.graph_height*(1-c)+1;d[1]=this.graph_top+this.graph_height-1;break;case 2:d[0]=this.graph_top+1;d[1]=this.graph_top+this.graph_height*(1-c)-1;break;case 3:f=c-this.minimum_value/this.spread;if(c>=this.zero){d[0]=this.graph_top+this.graph_height*(1-(f-this.zero))+1;d[1]=this.graph_top+this.graph_height*(1-this.zero)-1}else{d[0]=this.graph_top+this.graph_height*(1-(f-this.zero))+1;d[1]=this.graph_top+this.graph_height*(1-this.zero)-1}break;default:d[0]=0.0;d[1]=0.0}}});Bluff.Bar=new JS.Class(Bluff.Base,{bar_spacing:0.9,draw:function(){this.center_labels_over_point=(Bluff.keys(this.labels).length>this._5);this.callSuper();if(!this._a)return;this._1O()},_1O:function(){this._8=this._6/(this._5*this._2.length);var n=(this._8*(1-this.bar_spacing))/2;this._0.stroke_opacity=0.0;var m=new Bluff.BarConversion();m.graph_height=this._3;m.graph_top=this._7;if(this.minimum_value>=0){m.mode=1}else{if(this.maximum_value<=0){m.mode=2}else{m.mode=3;m.spread=this._i;m.minimum_value=this.minimum_value;m.zero=-this.minimum_value/this._i}}Bluff.each(this._9,function(j,k){var l=this._2[k][this.klass.DATA_VALUES_INDEX];Bluff.each(j[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._1+(this._8*(k+d+((this._2.length-1)*d)))+n;var g=f+this._8*this.bar_spacing;var h=[];m.getLeftYRightYscaled(c,h);this._0.fill=j[this.klass.DATA_COLOR_INDEX];this._0.rectangle(f,h[0],g,h[1]);this._E(f,h[0],g-f,h[1]-h[0],j[this.klass.DATA_LABEL_INDEX],j[this.klass.DATA_COLOR_INDEX],l[d]);var i=this._1+(this._2.length*this._8*d)+(this._2.length*this._8/2.0);this._c(i-(this.center_labels_over_point?this._8/2.0:0.0),d)},this)},this);if(this.center_labels_over_point)this._c(this._l,this._5)}});Bluff.Line=new JS.Class(Bluff.Base,{baseline_value:null,baseline_color:null,line_width:null,dot_radius:null,hide_dots:null,hide_lines:null,initialize:function(c){if(arguments.length>3)throw'Wrong number of arguments';if(arguments.length===1||(typeof arguments[1]!=='number'&&typeof arguments[1]!=='string'))this.callSuper(c,null);else this.callSuper();this.hide_dots=this.hide_lines=false;this.baseline_color='red';this.baseline_value=null},draw:function(){this.callSuper();if(!this._a)return;this.x_increment=(this._5>1)?(this._6/(this._5-1)):this._6;var m;if(this._S!==undefined){m=this._7+(this._3-this._S*this._3);this._0.push();this._0.stroke=this.baseline_color;this._0.fill_opacity=0.0;this._0.stroke_width=3.0;this._0.line(this._1,m,this._1+this._6,m);this._0.pop()}Bluff.each(this._9,function(i,j){var k=null,l=null;var n=this._2[j][this.klass.DATA_VALUES_INDEX];this._1P=this._1Q(i);Bluff.each(i[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._1+(this.x_increment*d);if(typeof c!=='number')return;this._c(f,d);var g=this._7+(this._3-c*this._3);this._0.stroke=i[this.klass.DATA_COLOR_INDEX];this._0.fill=i[this.klass.DATA_COLOR_INDEX];this._0.stroke_opacity=1.0;this._0.stroke_width=this.line_width||this._Q(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*6),3.0);var h=this.dot_radius||this._Q(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*2),7.0);if(!this.hide_lines&&k!==null&&l!==null){this._0.line(k,l,f,g)}else if(this._1P){this._0.circle(f,g,f-h,g)}if(!this.hide_dots)this._0.circle(f,g,f-h,g);this._E(f-h,g-h,2*h,2*h,i[this.klass.DATA_LABEL_INDEX],i[this.klass.DATA_COLOR_INDEX],n[d]);k=f;l=g},this)},this)},_13:function(){this.maximum_value=Math.max(this.maximum_value,this.baseline_value);this.callSuper();if(this.baseline_value!==null)this._S=this.baseline_value/this.maximum_value},_1Q:function(d){var f=0;Bluff.each(d[this.klass.DATA_VALUES_INDEX],function(c){if(c!==undefined)f+=1});return f===1}});Bluff.Dot=new JS.Class(Bluff.Base,{draw:function(){this.has_left_labels=true;this.callSuper();if(!this._a)return;var k=1.0;this._F=this._3/this._5;this._18=this._F*k/this._9.length;this._0.stroke_opacity=0.0;var l=Bluff.array_new(this._5,0),n=Bluff.array_new(this._5,this._1),m=(this._F*(1-k))/2;Bluff.each(this._9,function(i,j){Bluff.each(i[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._1+(c*this._6)-Math.round(this._18/6.0);var g=this._7+(this._F*d)+m+Math.round(this._18/2.0);if(j===0){this._0.stroke=this.marker_color;this._0.stroke_width=1.0;this._0.opacity=0.1;this._0.line(this._1,g,this._1+this._6,g)}this._0.fill=i[this.klass.DATA_COLOR_INDEX];this._0.stroke='transparent';this._0.circle(f,g,f+Math.round(this._18/3.0),g);var h=this._7+(this._F*d+this._F/2)+m;this._c(h,d)},this)},this)},_M:function(){if(this.hide_line_markers)return;this._0.stroke_antialias=false;this._0.stroke_width=1;var c=5;var d=this._17(this.maximum_value/c);for(var f=0;f<=c;f++){var g=(this._l-this._1)/c,h=this._l-(g*f)-1,i=f-c,j=Math.abs(i)*d;this._0.stroke=this.marker_color;this._0.line(h,this._g,h,this._g+0.5*this.klass.LABEL_MARGIN);if(!this.hide_line_numbers){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.pointsize=this._e(this.marker_font_size);this._0.gravity='center';this._0.annotate_scaled(0,0,h,this._g+(this.klass.LABEL_MARGIN*2.0),j,this._b)}this._0.stroke_antialias=true}},_c:function(c,d){if(this.labels[d]&&!this._q[d]){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._e(this.marker_font_size);this._0.gravity='east';this._0.annotate_scaled(1,1,this._1-this.klass.LABEL_MARGIN*2.0,c,this.labels[d],this._b);this._q[d]=true}}});Bluff.Net=new JS.Class(Bluff.Base,{hide_dots:null,line_width:null,dot_radius:null,initialize:function(){this.callSuper();this.hide_dots=false;this.hide_line_numbers=true},draw:function(){this.callSuper();if(!this._a)return;this._v=this._3/2.0;this._w=this._1+(this._6/2.0);this._x=this._7+(this._3/2.0)-10;this._R=this._6/(this._5-1);var s=this.dot_radius||this._Q(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*2.5),7.0);this._0.stroke_opacity=1.0;this._0.stroke_width=this.line_width||this._Q(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*4),3.0);var r;if(this._S!==undefined){r=this._7+(this._3-this._S*this._3);this._0.push();this._0.stroke_color=this.baseline_color;this._0.fill_opacity=0.0;this._0.stroke_width=5;this._0.line(this._1,r,this._1+this._6,r);this._0.pop()}Bluff.each(this._9,function(o){var p=null,q=null;Bluff.each(o[this.klass.DATA_VALUES_INDEX],function(c,d){if(c===undefined)return;var f=d*Math.PI*2/this._5,g=c*this._v,h=this._w+Math.sin(f)*g,i=this._x-Math.cos(f)*g,j=(d+10){this._0.fill=c[this.klass.DATA_COLOR_INDEX];var f=(c[this.klass.DATA_VALUES_INDEX][0]/o)*360;this._0.circle(n,m,n+k,m,p,p+f+0.5);var g=p+((p+f)-p)/2,h=Math.round((c[this.klass.DATA_VALUES_INDEX][0]/o)*100.0),i;if(h>=this.hide_labels_less_than){i=this._15(c[this.klass.DATA_VALUES_INDEX][0]);this._c(n,m,g,k+(k*this.klass.TEXT_OFFSET_PERCENTAGE),i)}p+=f}},this)},_c:function(c,d,f,g,h){var i=20.0,j=c,k=d,l=g+i,n=l*0.15,m=j+((l+n)*Math.cos(f*Math.PI/180)),o=k+(l*Math.sin(f*Math.PI/180));this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._e(this.marker_font_size);this._0.font_weight='bold';this._0.gravity='center';this._0.annotate_scaled(0,0,m,o,h,this._b)},_1R:function(){var d=0;Bluff.each(this._2,function(c){d+=c[this.klass.DATA_VALUES_INDEX][0]},this);return d}});Bluff.SideBar=new JS.Class(Bluff.Base,{bar_spacing:0.9,draw:function(){this.has_left_labels=true;this.callSuper();if(!this._a)return;this._G=this._3/this._5;this._8=this._G*this.bar_spacing/this._9.length;this._0.stroke_opacity=0.0;var q=Bluff.array_new(this._5,0),s=Bluff.array_new(this._5,this._1),r=(this._G*(1-this.bar_spacing))/2;Bluff.each(this._9,function(m,o){var p=this._2[o][this.klass.DATA_VALUES_INDEX];Bluff.each(m[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._1+(this._6-c*this._6-q[d]),g=this._1+this._6-q[d],h=g-f,i=s[d]-1,j=this._7+(this._G*d)+(this._8*o)+r,k=i+h,l=j+this._8;q[d]+=(c*this._6);this._0.stroke='transparent';this._0.fill=m[this.klass.DATA_COLOR_INDEX];this._0.rectangle(i,j,k,l);this._E(i,j,k-i,l-j,m[this.klass.DATA_LABEL_INDEX],m[this.klass.DATA_COLOR_INDEX],p[d]);var n=this._7+(this._G*d+this._G/2);this._c(n,d)},this)},this)},_M:function(){if(this.hide_line_markers)return;this._0.stroke_antialias=false;this._0.stroke_width=1;var c=5;var d=this._17(this.maximum_value/c),f,g,h,i;for(var j=0;j<=c;j++){f=(this._l-this._1)/c;g=this._l-(f*j)-1;h=j-c;i=Math.abs(h)*d;this._0.stroke=this.marker_color;this._0.line(g,this._g,g,this._7);if(!this.hide_line_numbers){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.pointsize=this._e(this.marker_font_size);this._0.gravity='center';this._0.annotate_scaled(0,0,g,this._g+(this.klass.LABEL_MARGIN*2.0),i,this._b)}}},_c:function(c,d){if(this.labels[d]&&!this._q[d]){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._e(this.marker_font_size);this._0.gravity='east';this._0.annotate_scaled(1,1,this._1-this.klass.LABEL_MARGIN*2.0,c,this.labels[d],this._b);this._q[d]=true}}});Bluff.Spider=new JS.Class(Bluff.Base,{hide_text:null,hide_axes:null,transparent_background:null,initialize:function(c,d,f){this.callSuper(c,f);this._1S=d;this.hide_legend=true},draw:function(){this.hide_line_markers=true;this.callSuper();if(!this._a)return;var c=this._3,d=this._3/2.0,f=this._1+(this._6-c)/2.0,g=this._1+(this._6/2.0),h=this._7+(this._3/2.0)-25;this._1T=d/this._1S;var i=this._1U(),j=0.0,k=(2*Math.PI)/this._2.length,l=0.0;if(!this.hide_axes)this._1V(g,h,d,k);this._1W(g,h,k)},_1n:function(c){return c*this._1T},_c:function(c,d,f,g,h){var i=50,j=c,k=d+0,l=j+((g+i)*Math.cos(f)),n=k+((g+i)*Math.sin(f));this._0.fill=this.marker_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._e(this.legend_font_size);this._0.stroke='transparent';this._0.font_weight='bold';this._0.gravity='center';this._0.annotate_scaled(0,0,l,n,h,this._b)},_1V:function(g,h,i,j,k){if(this.hide_axes)return;var l=0.0;Bluff.each(this._2,function(c){this._0.stroke=k||c[this.klass.DATA_COLOR_INDEX];this._0.stroke_width=5.0;var d=i*Math.cos(l);var f=i*Math.sin(l);this._0.line(g,h,g+d,h+f);if(!this.hide_text)this._c(g,h,l,i,c[this.klass.DATA_LABEL_INDEX]);l+=j},this)},_1W:function(d,f,g,h){var i=[],j=0.0;Bluff.each(this._2,function(c){i.push(d+this._1n(c[this.klass.DATA_VALUES_INDEX][0])*Math.cos(j));i.push(f+this._1n(c[this.klass.DATA_VALUES_INDEX][0])*Math.sin(j));j+=g},this);this._0.stroke_width=1.0;this._0.stroke=h||this.marker_color;this._0.fill=h||this.marker_color;this._0.fill_opacity=0.4;this._0.polyline(i)},_1U:function(){var d=0.0;Bluff.each(this._2,function(c){d+=c[this.klass.DATA_VALUES_INDEX][0]},this);return d}});Bluff.Base.StackedMixin=new JS.Module({_19:function(){var g={};Bluff.each(this._2,function(f){Bluff.each(f[this.klass.DATA_VALUES_INDEX],function(c,d){if(!g[d])g[d]=0.0;g[d]+=c},this)},this);for(var h in g){if(g[h]>this.maximum_value)this.maximum_value=g[h]}this.minimum_value=0}});Bluff.StackedArea=new JS.Class(Bluff.Base,{include:Bluff.Base.StackedMixin,last_series_goes_on_bottom:null,draw:function(){this._19();this.callSuper();if(!this._a)return;this._R=this._6/(this._5-1);this._0.stroke='transparent';var n=Bluff.array_new(this._5,0);var m=null;var o=this.last_series_goes_on_bottom?'reverse_each':'each';Bluff[o](this._9,function(h){var i=m;m=[];Bluff.each(h[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._1+(this._R*d);var g=this._7+(this._3-c*this._3-n[d]);n[d]+=(c*this._3);m.push(f);m.push(g);this._c(f,d)},this);var j,k,l;if(i){j=Bluff.array(m);for(k=i.length/2-1;k>=0;k--){j.push(i[2*k]);j.push(i[2*k+1])}j.push(m[0]);j.push(m[1])}else{j=Bluff.array(m);j.push(this._l);j.push(this._g-1);j.push(this._1);j.push(this._g-1);j.push(m[0]);j.push(m[1])}this._0.fill=h[this.klass.DATA_COLOR_INDEX];this._0.polyline(j)},this)}});Bluff.StackedBar=new JS.Class(Bluff.Base,{include:Bluff.Base.StackedMixin,bar_spacing:0.9,draw:function(){this._19();this.callSuper();if(!this._a)return;this._8=this._6/this._5;var m=(this._8*(1-this.bar_spacing))/2;this._0.stroke_opacity=0.0;var o=Bluff.array_new(this._5,0);Bluff.each(this._9,function(k,l){var n=this._2[l][this.klass.DATA_VALUES_INDEX];Bluff.each(k[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._1+(this._8*d)+(this._8*this.bar_spacing/2.0);this._c(f,d);if(c==0)return;var g=this._1+(this._8*d)+m;var h=this._7+(this._3-c*this._3-o[d])+1;var i=g+this._8*this.bar_spacing;var j=this._7+this._3-o[d]-1;o[d]+=(c*this._3);this._0.fill=k[this.klass.DATA_COLOR_INDEX];this._0.rectangle(g,h,i,j);this._E(g,h,i-g,j-h,k[this.klass.DATA_LABEL_INDEX],k[this.klass.DATA_COLOR_INDEX],n[d])},this)},this)}});Bluff.AccumulatorBar=new JS.Class(Bluff.StackedBar,{draw:function(){if(this._2.length!==1)throw'Incorrect number of datasets';var g=[],h=0,i=[];Bluff.each(this._2[0][this.klass.DATA_VALUES_INDEX],function(d){var f=-Infinity;Bluff.each(i,function(c){f=Math.max(f,c)});i.push((h>0)?(d+f):d);g.push(i[h]-d);h+=1},this);this.data("Accumulator",g);this.callSuper()}});Bluff.SideStackedBar=new JS.Class(Bluff.SideBar,{include:Bluff.Base.StackedMixin,bar_spacing:0.9,draw:function(){this.has_left_labels=true;this._19();this.callSuper();if(!this._a)return;this._8=this._3/this._5;var q=Bluff.array_new(this._5,0),s=Bluff.array_new(this._5,this._1),r=(this._8*(1-this.bar_spacing))/2;Bluff.each(this._9,function(m,o){this._0.fill=m[this.klass.DATA_COLOR_INDEX];var p=this._2[o][this.klass.DATA_VALUES_INDEX];Bluff.each(m[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._1+(this._6-c*this._6-q[d])+1;var g=this._1+this._6-q[d]-1;var h=g-f;var i=s[d],j=this._7+(this._8*d)+r,k=i+h,l=j+this._8*this.bar_spacing;s[d]+=h;q[d]+=(c*this._6-2);this._0.rectangle(i,j,k,l);this._E(i,j,k-i,l-j,m[this.klass.DATA_LABEL_INDEX],m[this.klass.DATA_COLOR_INDEX],p[d]);var n=this._7+(this._8*d)+(this._8*this.bar_spacing/2.0);this._c(n,d)},this)},this)},_1f:function(c,d){d=d||0;return this._1m(c,d)>this.maximum_value},_1m:function(d,f){var g=0;Bluff.each(this._2,function(c){g+=c[this.klass.DATA_VALUES_INDEX][f]},this);return g}});Bluff.Mini.Legend=new JS.Module({hide_mini_legend:false,_1a:function(){if(this.hide_mini_legend)return;this._1X=this._L;this._y+=this._2.length*this._D(this._e(this.legend_font_size))*1.7;this._X()},_1b:function(){if(this.hide_mini_legend)return;this._P=Bluff.map(this._2,function(c){return c[this.klass.DATA_LABEL_INDEX]},this);var f=40.0,g=10.0,h=100.0,i=40.0;if(this.font)this._0.font=this.font;this._0.pointsize=this.legend_font_size;var j=h,k=this._1X+i;this._u(function(){this._0.line(0.0,k,this._d,k)});Bluff.each(this._P,function(c,d){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._e(this.legend_font_size);this._0.stroke='transparent';this._0.font_weight='normal';this._0.gravity='west';this._0.annotate_scaled(this._d,1.0,j+(f*1.7),k,this._1Y(c),this._b);this._0.stroke='transparent';this._0.fill=this._2[d][this.klass.DATA_COLOR_INDEX];this._0.rectangle(j,k-f/2.0,j+f,k+f/2.0);k+=this._D(this.legend_font_size)*1.7},this);this._m=0},_1Y:function(c){var d=String(c);while(this._O(this._e(this.legend_font_size),d)>(this._j-this.legend_left_margin-this.right_margin)&&(d.length>1))d=d.substr(0,d.length-1);return d+(d.length=1?(c*i):1;var k=(d*i)>=1?(d*i):1;var h=this._T(this.pointsize,h);h.style.color=this.fill;h.style.fontWeight=this.font_weight;h.style.textAlign='center';h.style.left=(this._f*f+this._1Z(h,j))+'px';h.style.top=(this._h*g+this._20(h,k))+'px'},tooltip:function(d,f,g,h,i,j,k){if(g<0)d+=g;if(h<0)f+=h;var l=this._n.parentNode,n=document.createElement('div');n.className=this.klass.TARGET_CLASS;n.style.position='absolute';n.style.left=(this._f*d-3)+'px';n.style.top=(this._h*f-3)+'px';n.style.width=(this._f*Math.abs(g)+5)+'px';n.style.height=(this._h*Math.abs(h)+5)+'px';n.style.fontSize=0;n.style.overflow='hidden';Bluff.Event.observe(n,'mouseover',function(c){Bluff.Tooltip.show(i,j,k)});Bluff.Event.observe(n,'mouseout',function(c){Bluff.Tooltip.hide()});l.appendChild(n)},circle:function(c,d,f,g,h,i){var j=Math.sqrt(Math.pow(f-c,2)+Math.pow(g-d,2));this._4.fillStyle=this.fill;this._4.beginPath();var k=(h||0)*Math.PI/180;var l=(i||360)*Math.PI/180;if(h!==undefined&&i!==undefined){this._4.moveTo(this._f*(c+j*Math.cos(l)),this._h*(d+j*Math.sin(l)));this._4.lineTo(this._f*c,this._h*d);this._4.lineTo(this._f*(c+j*Math.cos(k)),this._h*(d+j*Math.sin(k)))}this._4.arc(this._f*c,this._h*d,this._f*j,k,l,false);this._4.fill()},line:function(c,d,f,g){this._4.strokeStyle=this.stroke;this._4.lineWidth=this.stroke_width;this._4.beginPath();this._4.moveTo(this._f*c,this._h*d);this._4.lineTo(this._f*f,this._h*g);this._4.stroke()},polyline:function(c){this._4.fillStyle=this.fill;this._4.globalAlpha=this.fill_opacity||1;try{this._4.strokeStyle=this.stroke}catch(e){}var d=c.shift(),f=c.shift();this._4.beginPath();this._4.moveTo(this._f*d,this._h*f);while(c.length>0){d=c.shift();f=c.shift();this._4.lineTo(this._f*d,this._h*f)}this._4.fill()},rectangle:function(c,d,f,g){var h;if(c>f){h=c;c=f;f=h}if(d>g){h=d;d=g;g=h}try{this._4.fillStyle=this.fill;this._4.fillRect(this._f*c,this._h*d,this._f*(f-c),this._h*(g-d))}catch(e){}try{this._4.strokeStyle=this.stroke;if(this.stroke!=='transparent')this._4.strokeRect(this._f*c,this._h*d,this._f*(f-c),this._h*(g-d))}catch(e){}},_1Z:function(c,d){var f=this._H(c).width;switch(this.gravity){case'west':return 0;case'east':return d-f;case'north':case'south':case'center':return(d-f)/2}},_20:function(c,d){var f=this._H(c).height;switch(this.gravity){case'north':return 0;case'south':return d-f;case'west':case'east':case'center':return(d-f)/2}},_1o:function(){var c=this._n.parentNode;if(c.className===this.klass.WRAPPER_CLASS)return c;c=document.createElement('div');c.className=this.klass.WRAPPER_CLASS;c.style.position='relative';c.style.border='none';c.style.padding='0 0 0 0';this._n.parentNode.insertBefore(c,this._n);c.appendChild(this._n);return c},_T:function(c,d){var f=this._21(d);f.style.fontFamily=this.font;f.style.fontSize=(typeof c==='number')?c+'px':c;return f},_21:function(c){var d=document.createElement('div');d.className=this.klass.TEXT_CLASS;d.style.position='absolute';d.appendChild(document.createTextNode(c));this._1o().appendChild(d);return d},_U:function(c){c.parentNode.removeChild(c);if(c.className===this.klass.TARGET_CLASS)Bluff.Event.stopObserving(c)},_H:function(c){var d=c.style.display;return(d&&d!=='none')?{width:c.offsetWidth,height:c.offsetHeight}:{width:c.clientWidth,height:c.clientHeight}}});Bluff.Event={_V:[],_1p:(window.attachEvent&&navigator.userAgent.indexOf('Opera')===-1),observe:function(d,f,g,h){var i=Bluff.map(this._1q(d,f),function(c){return c._22});if(Bluff.index(i,g)!==-1)return;var j=function(c){g.call(h||null,d,Bluff.Event._23(c))};this._V.push({_W:d,_1c:f,_22:g,_1r:j});if(d.addEventListener)d.addEventListener(f,j,false);else d.attachEvent('on'+f,j)},stopObserving:function(d){var f=d?this._1q(d):this._V;Bluff.each(f,function(c){if(c._W.removeEventListener)c._W.removeEventListener(c._1c,c._1r,false);else c._W.detachEvent('on'+c._1c,c._1r)})},_1q:function(d,f){var g=[];Bluff.each(this._V,function(c){if(d&&c._W!==d)return;if(f&&c._1c!==f)return;g.push(c)});return g},_23:function(c){if(!this._1p)return c;if(!c)return false;if(c._24)return c;c._24=true;var d=this._25(c);c.target=c.srcElement;c.pageX=d.x;c.pageY=d.y;return c},_25:function(c){var d=document.documentElement,f=document.body||{scrollLeft:0,scrollTop:0};return{x:c.pageX||(c.clientX+(d.scrollLeft||f.scrollLeft)-(d.clientLeft||0)),y:c.pageY||(c.clientY+(d.scrollTop||f.scrollTop)-(d.clientTop||0))}}};if(Bluff.Event._1p)window.attachEvent('onunload',function(){Bluff.Event.stopObserving();Bluff.Event._V=null});if(navigator.userAgent.indexOf('AppleWebKit/')>-1)window.addEventListener('unload',function(){},false);Bluff.Tooltip=new JS.Singleton({LEFT_OFFSET:20,TOP_OFFSET:-6,DATA_LENGTH:8,CLASS_NAME:'bluff-tooltip',setup:function(){this._o=document.createElement('div');this._o.className=this.CLASS_NAME;this._o.style.position='absolute';this.hide();document.body.appendChild(this._o);Bluff.Event.observe(document.body,'mousemove',function(c,d){this._o.style.left=(d.pageX+this.LEFT_OFFSET)+'px';this._o.style.top=(d.pageY+this.TOP_OFFSET)+'px'},this)},show:function(c,d,f){f=Number(String(f).substr(0,this.DATA_LENGTH));this._o.innerHTML='  '+c+' '+f+'';this._o.style.display=''},hide:function(){this._o.style.display='none'}});Bluff.Event.observe(window,'load',Bluff.Tooltip.method('setup'));Bluff.TableReader=new JS.Class({NUMBER_FORMAT:/\-?(0|[1-9]\d*)(\.\d+)?(e[\+\-]?\d+)?/i,initialize:function(c,d){this._26=(typeof c==='string')?document.getElementById(c):c;this._1s=!!d},get_data:function(){if(!this._2)this._1t();return this._2},get_labels:function(){if(!this._1d)this._1t();return this._1d},get_title:function(){return this._27},get_series:function(c){if(this._2[c])return this._2[c];return this._2[c]={points:[]}},_1t:function(){this._I=this._p=0;this._J=this._K=0;this._2=[];this._1d={};this._s=[];this._t=[];this._1u(this._26);if((this._s.length>1&&this._t.length===1)||this._s.length]+>/gi,'')},extend:{Mixin:new JS.Module({data_from_table:function(d,f){var g=new Bluff.TableReader(d,f),h=g.get_data();Bluff.each(h,function(c){this.data(c.name,c.points)},this);this.labels=g.get_labels();this.title=g.get_title()||this.title}})}});Bluff.Base.include(Bluff.TableReader.Mixin); \ No newline at end of file diff --git a/v1.1.0/metric_fu/output/excanvas.js b/v1.1.0/metric_fu/output/excanvas.js deleted file mode 100644 index a34ca1d..0000000 --- a/v1.1.0/metric_fu/output/excanvas.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2006 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -document.createElement("canvas").getContext||(function(){var s=Math,j=s.round,F=s.sin,G=s.cos,V=s.abs,W=s.sqrt,k=10,v=k/2;function X(){return this.context_||(this.context_=new H(this))}var L=Array.prototype.slice;function Y(b,a){var c=L.call(arguments,2);return function(){return b.apply(a,c.concat(L.call(arguments)))}}var M={init:function(b){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var a=b||document;a.createElement("canvas");a.attachEvent("onreadystatechange",Y(this.init_,this,a))}},init_:function(b){b.namespaces.g_vml_|| -b.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");b.namespaces.g_o_||b.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!b.styleSheets.ex_canvas_){var a=b.createStyleSheet();a.owningElement.id="ex_canvas_";a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var c=b.getElementsByTagName("canvas"),d=0;for(;d','","");this.element_.insertAdjacentHTML("BeforeEnd",t.join(""))};i.stroke=function(b){var a=[],c=P(b?this.fillStyle:this.strokeStyle),d=c.color,f=c.alpha*this.globalAlpha;a.push("g.x)g.x=e.x;if(h.y==null||e.yg.y)g.y=e.y}}a.push(' ">');if(b)if(typeof this.fillStyle=="object"){var m=this.fillStyle,r=0,n={x:0,y:0},o=0,q=1;if(m.type_=="gradient"){var t=m.x1_/this.arcScaleX_,E=m.y1_/this.arcScaleY_,p=this.getCoords_(m.x0_/this.arcScaleX_,m.y0_/this.arcScaleY_), -z=this.getCoords_(t,E);r=Math.atan2(z.x-p.x,z.y-p.y)*180/Math.PI;if(r<0)r+=360;if(r<1.0E-6)r=0}else{var p=this.getCoords_(m.x0_,m.y0_),w=g.x-h.x,x=g.y-h.y;n={x:(p.x-h.x)/w,y:(p.y-h.y)/x};w/=this.arcScaleX_*k;x/=this.arcScaleY_*k;var R=s.max(w,x);o=2*m.r0_/R;q=2*m.r1_/R-o}var u=m.colors_;u.sort(function(ba,ca){return ba.offset-ca.offset});var J=u.length,da=u[0].color,ea=u[J-1].color,fa=u[0].alpha*this.globalAlpha,ga=u[J-1].alpha*this.globalAlpha,S=[],l=0;for(;l')}else a.push('');else{var K=this.lineScale_*this.lineWidth;if(K<1)f*=K;a.push("')}a.push("");this.element_.insertAdjacentHTML("beforeEnd",a.join(""))};i.fill=function(){this.stroke(true)};i.closePath=function(){this.currentPath_.push({type:"close"})};i.getCoords_=function(b,a){var c=this.m_;return{x:k*(b*c[0][0]+a*c[1][0]+c[2][0])-v,y:k*(b*c[0][1]+a*c[1][1]+c[2][1])-v}};i.save=function(){var b={};O(this,b);this.aStack_.push(b);this.mStack_.push(this.m_);this.m_=y(I(),this.m_)};i.restore=function(){O(this.aStack_.pop(), -this);this.m_=this.mStack_.pop()};function ha(b){var a=0;for(;a<3;a++){var c=0;for(;c<2;c++)if(!isFinite(b[a][c])||isNaN(b[a][c]))return false}return true}function A(b,a,c){if(!!ha(a)){b.m_=a;if(c)b.lineScale_=W(V(a[0][0]*a[1][1]-a[0][1]*a[1][0]))}}i.translate=function(b,a){A(this,y([[1,0,0],[0,1,0],[b,a,1]],this.m_),false)};i.rotate=function(b){var a=G(b),c=F(b);A(this,y([[a,c,0],[-c,a,0],[0,0,1]],this.m_),false)};i.scale=function(b,a){this.arcScaleX_*=b;this.arcScaleY_*=a;A(this,y([[b,0,0],[0,a, -0],[0,0,1]],this.m_),true)};i.transform=function(b,a,c,d,f,h){A(this,y([[b,a,0],[c,d,0],[f,h,1]],this.m_),true)};i.setTransform=function(b,a,c,d,f,h){A(this,[[b,a,0],[c,d,0],[f,h,1]],true)};i.clip=function(){};i.arcTo=function(){};i.createPattern=function(){return new U};function D(b){this.type_=b;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}D.prototype.addColorStop=function(b,a){a=P(a);this.colors_.push({offset:b,color:a.color,alpha:a.alpha})};function U(){}G_vmlCanvasManager= -M;CanvasRenderingContext2D=H;CanvasGradient=D;CanvasPattern=U})(); diff --git a/v1.1.0/metric_fu/output/js-class.js b/v1.1.0/metric_fu/output/js-class.js deleted file mode 100644 index 923fa96..0000000 --- a/v1.1.0/metric_fu/output/js-class.js +++ /dev/null @@ -1 +0,0 @@ -JS={extend:function(a,b){b=b||{};for(var c in b){if(a[c]===b[c])continue;a[c]=b[c]}return a},makeFunction:function(){return function(){return this.initialize?(this.initialize.apply(this,arguments)||this):this}},makeBridge:function(a){var b=function(){};b.prototype=a.prototype;return new b},bind:function(){var a=JS.array(arguments),b=a.shift(),c=a.shift()||null;return function(){return b.apply(c,a.concat(JS.array(arguments)))}},callsSuper:function(a){return a.SUPER===undefined?a.SUPER=/\bcallSuper\b/.test(a.toString()):a.SUPER},mask:function(a){var b=a.toString().replace(/callSuper/g,'super');a.toString=function(){return b};return a},array:function(a){if(!a)return[];if(a.toArray)return a.toArray();var b=a.length,c=[];while(b--)c[b]=a[b];return c},indexOf:function(a,b){for(var c=0,d=a.length;c':''),d=this.__meta__=new JS.Module(c?c+'.':'',{},{_1:this});d.include(this.klass.__mod__,false);return d},equals:function(a){return this===a},extend:function(a,b){return this.__eigen__().include(a,b,{_2:this})},hash:function(){return this.__hashcode__=this.__hashcode__||JS.Kernel.getHashCode()},isA:function(a){return this.__eigen__().includes(a)},method:function(a){var b=this,c=b.__mcache__=b.__mcache__||{};if((c[a]||{}).fn===b[a])return c[a].bd;return(c[a]={fn:b[a],bd:JS.bind(b[a],b)}).bd},methods:function(){return this.__eigen__().instanceMethods(true)},tap:function(a,b){a.call(b||null,this);return this}}),{__hashIndex__:0,getHashCode:function(){this.__hashIndex__+=1;return(Math.floor(new Date().getTime()/1000)+this.__hashIndex__).toString(16)}});JS.Module.include(JS.Kernel);JS.extend(JS.Module,JS.Kernel.__fns__);JS.Class.include(JS.Kernel);JS.extend(JS.Class,JS.Kernel.__fns__);JS.Interface=new JS.Class({initialize:function(d){this.test=function(a,b){var c=d.length;while(c--){if(!JS.isFn(a[d[c]]))return b?d[c]:false}return true}},extend:{ensure:function(){var a=JS.array(arguments),b=a.shift(),c,d;while(c=a.shift()){d=c.test(b,true);if(d!==true)throw new Error('object does not implement '+d+'()');}}}});JS.Singleton=new JS.Class({initialize:function(a,b,c){return new(new JS.Class(a,b,c))}}); \ No newline at end of file diff --git a/v1.1.0/metric_fu/output/lib_mobylette_helmet_faker.rb.html b/v1.1.0/metric_fu/output/lib_mobylette_helmet_faker.rb.html deleted file mode 100644 index f2accdc..0000000 --- a/v1.1.0/metric_fu/output/lib_mobylette_helmet_faker.rb.html +++ /dev/null @@ -1,38 +0,0 @@ -
    1 
    module Mobylette
    -
    2 
      module Helmet
    -
    3 
    -
    4 
        # Forces the helper to think that all requests come
    -
    5 
        # from a mobile device
    -
    6 
        module Faker
    -
    7 
          extend ActiveSupport::Concern
    -
    8 
    -
    9 
          included do
    -
    10 
            cattr_accessor :is_mobile_request
    -
    11 
          end
    -
    12 
    -
    13
    • Score of 1.20 » flog
          def is_mobile_request?
    -
    14 
            is_mobile_request
    -
    15 
          end
    -
    16 
    -
    17 
        end
    -
    18 
      end
    -
    19 
    end
    -
    diff --git a/v1.1.0/metric_fu/output/lib_mobylette_helmet_helpers.rb.html b/v1.1.0/metric_fu/output/lib_mobylette_helmet_helpers.rb.html deleted file mode 100644 index 403654e..0000000 --- a/v1.1.0/metric_fu/output/lib_mobylette_helmet_helpers.rb.html +++ /dev/null @@ -1,53 +0,0 @@ -
    1 
    module Mobylette
    -
    2 
      module Helmet
    -
    3 
        # This module is only for testing the view's helpers of the module
    -
    4 
        # it simulates the Helmet helpers and the controller methods
    -
    5 
        # that are necessary for the tests
    -
    6 
        module Helpers
    -
    7 
          extend ActiveSupport::Concern
    -
    8 
    -
    9 
          included do
    -
    10 
            cattr_accessor :user_agent
    -
    11 
          end
    -
    12 
    -
    13 
    -
    14
    • Score of 1.70 » flog
          def force_mobile_request_agent
    -
    15 
            insert_faker
    -
    16 
            ActionController::Base.is_mobile_request = true
    -
    17 
          end
    -
    18 
    -
    19
    • Score of 1.70 » flog
          def reset_test_request_agent
    -
    20 
            insert_faker
    -
    21 
            ActionController::Base.is_mobile_request = false
    -
    22 
          end
    -
    23 
    -
    24 
          private
    -
    25 
    -
    26
    • Score of 6.32 » flog
          def insert_faker
    -
    27 
            return if ActionController::Base.included_modules.include?(Mobylette::Helmet::Faker)
    -
    28 
            ActionController::Base.send(:include, Mobylette::Helmet::Faker)
    -
    29 
          end
    -
    30 
    -
    31 
    -
    32 
        end
    -
    33 
      end
    -
    34 
    end
    -
    diff --git a/v1.1.0/metric_fu/output/lib_mobylette_railtie.rb.html b/v1.1.0/metric_fu/output/lib_mobylette_railtie.rb.html deleted file mode 100644 index 9827cd4..0000000 --- a/v1.1.0/metric_fu/output/lib_mobylette_railtie.rb.html +++ /dev/null @@ -1,29 +0,0 @@ -
    1 
    module Mobylette
    -
    2 
      class Railtie < ::Rails::Railtie
    -
    3 
        initializer :mobylette do
    -
    4 
          ActiveSupport.on_load(:action_controller) do
    -
    5 
            ::ActionController::Base.send(:include, Mobylette::Controllers::RespondToMobileRequests)
    -
    6 
            ::ActionController::Base.helper Mobylette::Controllers::Helpers
    -
    7 
          end
    -
    8
    • Score of 6.87 » flog
        end
    -
    9 
      end
    -
    10 
    end
    -
    diff --git a/v1.1.0/metric_fu/output/rails_best_practices.js b/v1.1.0/metric_fu/output/rails_best_practices.js deleted file mode 100644 index e9be902..0000000 --- a/v1.1.0/metric_fu/output/rails_best_practices.js +++ /dev/null @@ -1,11 +0,0 @@ - var g = new Bluff.Line('graph', "1000x600"); - g.theme_37signals(); - g.tooltips = true; - g.title_font_size = "24px" - g.legend_font_size = "12px" - g.marker_font_size = "10px" - - g.title = 'Rails Best Practices: design problems'; - g.data('rails_best_practices', []); - g.labels = {}; - g.draw();