stripe_invoice 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca38f3b597240b313cf72a6e8a8995804d89a0bb
4
- data.tar.gz: c89b782ea2e23bc25811e2297f4bb4b0b921bc19
3
+ metadata.gz: a23947d740838f2a15b0b4c65a4dcad30845bef7
4
+ data.tar.gz: 384acd14657cafb4f05bf884a5f5786845604bbc
5
5
  SHA512:
6
- metadata.gz: d082aaa12c5700e5057b77e0e04b1e0796e0f01f590616edd3c310b2d59d09af4a81e7221a24b87257fb198f1d8e3e3213569f1cebc863cf81d7e5388eeeb4df
7
- data.tar.gz: 91652c4e4341c8f757ffb4169f85771498e1426ff49efe987dd6f9f8ad41b15691ce899c4b14a12108f604fbc8e8cc35c0d4d6cb3cf7bbd6b538ae9064a74872
6
+ metadata.gz: 73b1f5e41615564946d0ce8b63fe64d6d577e04f9aa78af1acebf28f452180e85250a76b93242137a7b9b90342d1e31a19dceed1ea452cc7eac80f3ac407eea5
7
+ data.tar.gz: 2378c52b5d2f71529102b7faad9e492a938c57a31c2613e7d723e1f1463d80eee96529e6cb1a2bd50c65f1b6aa705bb230c1c66ee1fec2c003a421bf73b9af3a
@@ -1,4 +1,4 @@
1
- = StripeInvoice
1
+ # StripeInvoice
2
2
 
3
3
  StripeInvoice makes it easy for you to show invoices/receipts to the customers of your [Koudoku](https://github.com/andrewculver/koudoku/)-based Rails application.
4
4
  It downloads the last 100 invoices via the Stripe API, stores them in a table in the database and renders a basic
@@ -6,5 +6,12 @@ module StripeInvoice
6
6
  end
7
7
 
8
8
  alias_method :ft, :format_timestamp
9
+
10
+ # returns TRUE if the controller belongs to StripeInvoice
11
+ # false in all other cases, for convenience when executing filters
12
+ # in the main application
13
+ def stripe_invoice_controller?
14
+ is_a? StripeInvoice::ApplicationController
15
+ end
9
16
  end
10
17
  end
@@ -29,5 +29,14 @@ module StripeInvoice
29
29
  end
30
30
 
31
31
  alias_method :fc, :format_currency
32
+
33
+ # checks the plan's metadata for a custom public name
34
+ # and uses that if available - else it will use plan[:name]
35
+ def plan_public_name(plan)
36
+ plan = plan.with_indifferent_access
37
+ (plan[:metadata] &&
38
+ plan [:metadata][:stripe_invoice] &&
39
+ plan[:metadata][:stripe_invoice][:public_name]) || plan[:name]
40
+ end
32
41
  end
33
42
  end
@@ -4,7 +4,7 @@ require 'rails/generators'
4
4
  module StripeInvoice
5
5
  class InstallGenerator < Rails::Generators::Base
6
6
  include Rails::Generators::Migration
7
- source_root File.expand_path("../../../../app/views/stripe_invoice/invoices", __FILE__)
7
+ source_root "#{StripeInvoice::Engine.root}/app/views/stripe_invoice/invoices"
8
8
  desc "installs stripe_invoice"
9
9
 
10
10
  def install
@@ -23,6 +23,5 @@ module StripeInvoice
23
23
  def engine_directory_path
24
24
  "#{StripeInvoice::Engine.root}/app/views/stripe_invoice/invoices"
25
25
  end
26
-
27
26
  end
28
27
  end
@@ -1,5 +1,13 @@
1
1
  module StripeInvoice
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace StripeInvoice
4
+
5
+ # loads StripeInvoice::ApplicationHelper into ::ApplicationController
6
+ # so we can use #stripe_invoice_controller? in the main_app
7
+ initializer 'load_stripe_invoice_helpers' do
8
+ ActiveSupport.on_load(:action_controller) do
9
+ include StripeInvoice::ApplicationHelper
10
+ end
11
+ end
4
12
  end
5
13
  end
@@ -1,3 +1,3 @@
1
1
  module StripeInvoice
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe_invoice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christoph Engelhardt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-08 00:00:00.000000000 Z
11
+ date: 2014-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -103,7 +103,7 @@ extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
105
  - MIT-LICENSE
106
- - README.rdoc
106
+ - README.md
107
107
  - Rakefile
108
108
  - app/assets/javascripts/stripe_invoice/application.js
109
109
  - app/assets/javascripts/stripe_invoice/invoices.js
@@ -160,7 +160,7 @@ files:
160
160
  - test/test_helper.rb
161
161
  - test/unit/helpers/stripe_invoice/invoices_helper_test.rb
162
162
  - test/unit/stripe_invoice/invoice_test.rb
163
- homepage: http://www.it-engelhardt.de/stripe_invoice
163
+ homepage: https://github.com/yas4891/stripe_invoice
164
164
  licenses: []
165
165
  metadata: {}
166
166
  post_install_message: