Skip to content

Commit d846a68

Browse files
barnaclebarnesGlen Barnesfemmon
authored
Feature/rails 8 (#34)
* Allow rails 7, fix rspec deprication/warnings * Bump version * Added Rails 7.1 Compatibiity and upgraded other Gems * updated gems * Add CustomReports API * Add CustomReports API * Rails 7.2 * Support Rails 8 * Bump version --------- Co-authored-by: Glen Barnes <gbarnes@oncell.com> Co-authored-by: femmon <49613439+femmon@users.noreply.github.com>
1 parent 35d87ee commit d846a68

6 files changed

Lines changed: 27 additions & 8 deletions

File tree

autometal-piwik.gemspec

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Gem::Specification.new do |s|
1919

2020
s.add_dependency('xml-simple')
2121
s.add_dependency('rest-client')
22-
s.add_dependency('activesupport', '>= 3.0', '< 7.0')
23-
s.add_development_dependency('rspec', '< 3.0')
24-
s.add_development_dependency('rspec-its', '< 3.0')
22+
s.add_dependency('activesupport', '>= 3.0', '< 9')
23+
s.add_development_dependency('rspec', '< 4.0')
24+
s.add_development_dependency('rspec-mocks', '< 4.0')
25+
s.add_development_dependency('rspec-its', '< 4.0')
2526
end

lib/piwik.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
provider visit_frequency multi_sites mobile_messaging
1414
custom_variables languages_manager goals example_api api
1515
site user events custom_dimensions devices_detection
16-
segment segment_editor
16+
segment segment_editor custom_reports
1717
}.each { |r| require "piwik/#{r}" }
1818

1919
module Piwik

lib/piwik/custom_reports.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module Piwik
2+
class CustomReports < ApiModule
3+
available_methods %W{
4+
addCustomReport
5+
updateCustomReport
6+
getConfiguredReports
7+
getConfiguredReport
8+
deleteCustomReport
9+
getAvailableCategories
10+
getAvailableReportTypes
11+
getAvailableDimensions
12+
getAvailableMetrics
13+
getCustomReport
14+
}
15+
end
16+
end

lib/piwik/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Piwik
2-
VERSION = "1.0.3"
2+
VERSION = "1.0.5"
33
end

spec/spec_helper.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
RSpec.configure do |config|
55
Dir[File.join(File.dirname(__FILE__),'spec','support''**','*.rb')].each {|f| require f}
6-
config.mock_with :rspec
6+
config.expect_with(:rspec) { |c| c.syntax = [:should, :expect] }
77
config.order = "random"
8+
9+
config.mock_with(:rspec) { |mocks| mocks.syntax = [:expect, :should] }
810
end
911

1012
def stub_rails_env &block
@@ -26,7 +28,7 @@ def stub_api_calls
2628
# will always return a success response
2729
Piwik::Base.stub(:call) do |method,params,piwik_url,auth_token|
2830
resp_file = File.join(File.dirname(__FILE__),'files',"#{method}.xml")
29-
xml = if File.exists?(resp_file)
31+
xml = if File.exist?(resp_file)
3032
File.binread resp_file
3133
else
3234
File.binread File.join(success_response)

spec/user_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
subject.destroy.should eq(true)
2222
}
2323

24-
it { expect {Piwik::User.load('mike_ness')}.to raise_error }
24+
it { expect {Piwik::User.load('mike_ness')}.to raise_error(Piwik::ApiError) }
2525
describe "#load existing" do
2626
before {
2727
@user = build(:user)

0 commit comments

Comments
 (0)