koudoku 1.1.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10af897228d773743369bb52e611aaf35a87d78a
4
- data.tar.gz: c1a69b4002c5c9f9fe0b3f7abc5bf5285ec4c254
3
+ metadata.gz: 014fa4c5942241aa28303b621413ebca94c1debc
4
+ data.tar.gz: a36a27fc806f8dbaf0d5ce563a9cd8bc7a18f1fe
5
5
  SHA512:
6
- metadata.gz: fb521446bc4f2260d7a852ceab41e1015fef4aa8f930062ae3feb0b5f96dec8381b254399caf3ec6aa398a1aff26a754a3deca3194a23d8a52179514c9db8d8e
7
- data.tar.gz: 69c13f1387242587f98833ce381822ab7eba2c977dca48e60a9e648757739bb359ec10b0c9bc6c9d6d4ade947d897722e0d125c3977e2495b0f976efced9db8e
6
+ metadata.gz: e077820743b976d6b261807db7b01492450033861806900e601822982a2811717c2325e912fa71b2d3ef03204eb8e86102f3c352283aefc4bdb135dc13f1925e
7
+ data.tar.gz: 656010d4338ffea9add5f0682dbdd263261eac84fc553ef29a36a971a57b5ca8881786c2be1409bcc53ebd77cf53b12b7a634ede638fc0cb53def7fa17fb71a9
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
3
 
4
- APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
5
- load 'rails/tasks/engine.rake'
6
-
7
- require 'rspec/core/rake_task'
8
- RSpec::Core::RakeTask.new(spec: 'app:db:test:prepare')
9
-
10
- task default: :spec
4
+ # APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
5
+ # load 'rails/tasks/engine.rake'
6
+ #
7
+ # require 'rspec/core/rake_task'
8
+ # RSpec::Core::RakeTask.new(spec: 'app:db:test:prepare')
9
+ #
10
+ # task default: :spec
@@ -54,7 +54,7 @@ module Koudoku::Subscription
54
54
 
55
55
  end
56
56
 
57
- # otherwise
57
+ # when customer DOES NOT exist in stripe ..
58
58
  else
59
59
  # if a new plan has been selected
60
60
  if self.plan.present?
@@ -1,6 +1,10 @@
1
1
  module Koudoku
2
2
  class ApplicationController < ::ApplicationController
3
- layout 'application'
3
+ layout Koudoku.layout
4
4
  helper :application
5
+
6
+ # stolen from http://stackoverflow.com/questions/9232175/access-main-app-helpers-when-overridings-a-rails-engine-view-layout#comment44856124_19453140
7
+ # to solve the problem of having to reference "main_app.$some_model_path" in layouts
8
+ helper Rails.application.routes.url_helpers
5
9
  end
6
10
  end
@@ -22,5 +22,11 @@ module Koudoku
22
22
  end
23
23
  end
24
24
 
25
+ # returns TRUE if the controller belongs to Koudoku
26
+ # false in all other cases, for convenience when executing filters
27
+ # in the main application
28
+ def koudoku_controller?
29
+ is_a? Koudoku::ApplicationController
30
+ end
25
31
  end
26
32
  end
@@ -6,6 +6,9 @@ Koudoku.setup do |config|
6
6
  Stripe.api_version = '2015-01-11' #Making sure the API version used is compatible.
7
7
  # config.prorate = false # Default is true, set to false to disable prorating subscriptions
8
8
  # config.free_trial_length = 30
9
+
10
+ # Specify layout you want to use for the subscription pages, default is application
11
+ config.layout = 'application'
9
12
 
10
13
  # you can subscribe to additional webhooks here
11
14
  # we use stripe_event under the hood and you can subscribe using the
@@ -19,6 +19,9 @@ module Koudoku
19
19
  mattr_accessor :prorate
20
20
  @@prorate = true
21
21
 
22
+ mattr_accessor :layout
23
+ @@layout = nil
24
+
22
25
  def self.webhooks_api_key=(key)
23
26
  raise "Koudoku no longer uses an API key to secure webhooks, please delete the line from \"config/initializers/koudoku.rb\""
24
27
  end
@@ -1,3 +1,3 @@
1
1
  module Koudoku
2
- VERSION = "1.1.2"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koudoku
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails