stripe_invoice 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/{README.rdoc → README.md} +1 -1
- data/app/helpers/stripe_invoice/application_helper.rb +7 -0
- data/app/helpers/stripe_invoice/invoices_helper.rb +9 -0
- data/lib/generators/stripe_invoice/install_generator.rb +1 -1
- data/lib/generators/stripe_invoice/views_generator.rb +0 -1
- data/lib/stripe_invoice/engine.rb +8 -0
- data/lib/stripe_invoice/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a23947d740838f2a15b0b4c65a4dcad30845bef7
|
4
|
+
data.tar.gz: 384acd14657cafb4f05bf884a5f5786845604bbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73b1f5e41615564946d0ce8b63fe64d6d577e04f9aa78af1acebf28f452180e85250a76b93242137a7b9b90342d1e31a19dceed1ea452cc7eac80f3ac407eea5
|
7
|
+
data.tar.gz: 2378c52b5d2f71529102b7faad9e492a938c57a31c2613e7d723e1f1463d80eee96529e6cb1a2bd50c65f1b6aa705bb230c1c66ee1fec2c003a421bf73b9af3a
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
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
|
7
|
+
source_root "#{StripeInvoice::Engine.root}/app/views/stripe_invoice/invoices"
|
8
8
|
desc "installs stripe_invoice"
|
9
9
|
|
10
10
|
def install
|
@@ -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
|
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.
|
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-
|
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.
|
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:
|
163
|
+
homepage: https://github.com/yas4891/stripe_invoice
|
164
164
|
licenses: []
|
165
165
|
metadata: {}
|
166
166
|
post_install_message:
|