stripe-cli-ruby 1.30.0-x86_64-linux → 1.54.1-x86_64-linux

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
  SHA256:
3
- metadata.gz: 4467c1edd4eb03ef93006e9751f378f76fc7b1f845eb237499e99fdd7d628bf3
4
- data.tar.gz: bde57f176829ed8ddbc9b45e468217bd05d28849696f04bbcde62fe0795e966f
3
+ metadata.gz: 0d4661d3e9c5e1c37e625d94b5e97d5279aa45983d3224dd96117d7159df255b
4
+ data.tar.gz: 4d1736ee6f6589c9e4ae35670ac8fa4b4e7a52cf2901a46661f97a21e3b037cc
5
5
  SHA512:
6
- metadata.gz: 41129ab712b2ab99be0830241ab68cb625e4580630f71e974d9b3570c508c0967172a706b280e4fee9c47eaf36579cffc463ca5df1c4e6e89364fd9749da6090
7
- data.tar.gz: a770e055257425dcd46f358a05138c2d3bce1011600754fe1ba7966e074d66fdc53b083321a962c0ddeb4a8571f2a557ccc07e076df04f8e1749ce834062e4c7
6
+ metadata.gz: f0741ad0e6941db1017cf7ad7d94b0e3e890bb087a052084da1264ff8bb491ecbc4058bbbba4288ca7d6327b74b5dc0f23e7de68b2091bb2fc2f35f406ea2756
7
+ data.tar.gz: a40f34ac2b6d9ffc7db13fda5748f1d17c291ef17d8584aae61ea733fc425b6fa44d17f3138335130f3a69d3ec7d4c544ab558164abf6696a59701be223bbc53
data/README.md CHANGED
@@ -13,7 +13,7 @@ Supported platforms are:
13
13
  - `arm64-darwin` (macos-arm64)
14
14
  - `x86_64-darwin` (macos-x64)
15
15
  - `x86_64-linux` (linux-x64)
16
- - `arm-linux` (linux-armv7)
16
+ - `aarch64-linux` (linux-arm64)
17
17
 
18
18
  Install the gem and add to the application's Gemfile by executing:
19
19
 
@@ -39,7 +39,7 @@ The gem makes available `StripeCLI.executable` which is the path to the vendored
39
39
  ```ruby
40
40
  require "stripe-cli-ruby"
41
41
  StripeCLI.executable
42
- # => "/path/to/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/stripe-cli-ruby-0.1.0-x86_64-linux/exe/x86_64-linux/stripe"
42
+ # => "/path/to/gems/stripe-cli-ruby-1.33.0-x86_64-linux/exe/x86_64-linux/stripe"
43
43
  ```
44
44
 
45
45
  ### Command line
@@ -52,8 +52,8 @@ $ bundle exec which stripe
52
52
  /path/to/installs/ruby/3.3/bin/stripe
53
53
 
54
54
  # run the actual executable through the shim
55
- $ bundle exec stripe --help
56
- stripe version 1.25.1
55
+ $ bundle exec stripe --version
56
+ stripe version 1.33.0
57
57
  ```
58
58
 
59
59
  ## Forwarding events to your web server
@@ -79,7 +79,7 @@ You can grab your *signing secret* using `StripeCLI.signing_secret`. For example
79
79
  # config/environments/development.rb
80
80
  config.stripe_signing_secret = StripeCLI.signing_secret(Stripe.api_key)
81
81
 
82
- # app/constrollers/stripe_events_controller.rb
82
+ # app/controllers/stripe_events_controller.rb
83
83
  class StripeEventsController < ActionController::API
84
84
  before_action :set_event
85
85
 
@@ -110,9 +110,17 @@ end
110
110
 
111
111
  ## Development
112
112
 
113
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
113
+ Run `bin/setup` to install dependencies, `bundle exec rake download` to fetch the Stripe CLI binaries, and `bundle exec rake test` to run the tests. Set `TEST_STRIPE_API_KEY` to a test-mode key to run the tests that talk to Stripe.
114
114
 
115
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `stripe-cli-ruby.gemspec`, and then run `bin/cut`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` files to [rubygems.org](https://rubygems.org).
115
+ ## Releases
116
+
117
+ Releases are automatic:
118
+
119
+ 1. The `update` workflow checks for a new Stripe CLI release every day. When there is one, the workflow bumps `StripeCLI::VERSION` and `StripeCLI::Upstream::VERSION` and pushes the commit to `main`.
120
+ 2. The `ci` workflow tests every push to `main`, builds a gem per platform, and installs each one on its platform.
121
+ 3. When `StripeCLI::VERSION` isn't tagged yet, `ci` pushes the gems to rubygems.org with [trusted publishing](https://guides.rubygems.org/trusted-publishing/) and creates a GitHub release.
122
+
123
+ To ship a fix without a new Stripe CLI version, bump `StripeCLI::VERSION` to something like `1.33.0.1` and push to `main`.
116
124
 
117
125
  ## Contributing
118
126
 
Binary file
@@ -3,6 +3,7 @@
3
3
  require "puma"
4
4
  require "puma/plugin"
5
5
  require "stripe"
6
+ require "stripe_cli"
6
7
 
7
8
  Puma::Plugin.create do
8
9
  def start(launcher)
@@ -10,11 +11,9 @@ Puma::Plugin.create do
10
11
 
11
12
  launcher.events.on_booted do
12
13
  launcher.log_writer.log "Stripe: forwarding webhooks to #{forward_to}"
13
- @pid = fork do
14
- exec "#{StripeCLI.executable} listen --forward-to #{forward_to} --api-key #{Stripe.api_key}"
15
- rescue Errno::ENOENT
16
- launcher.log_writer.log "[Stripe] Not found. See https://docs.stripe.com/stripe-cli#install"
17
- end
14
+ @pid = spawn(StripeCLI.executable, "listen", "--all-snapshot", "--forward-to", forward_to.to_s, "--api-key", Stripe.api_key.to_s)
15
+ rescue StripeCLI::UnsupportedPlatformException, StripeCLI::ExecutableNotFoundException, Errno::ENOENT => e
16
+ launcher.log_writer.log "[Stripe] Could not start the Stripe CLI: #{e.message}"
18
17
  end
19
18
 
20
19
  launcher.events.on_stopped { stop_stripe }
@@ -22,9 +21,10 @@ Puma::Plugin.create do
22
21
 
23
22
  private
24
23
  def stop_stripe
25
- Process.waitpid(@pid, Process::WNOHANG)
24
+ return unless @pid
25
+
26
26
  @launcher.log_writer.log "[Stripe] Stopping..."
27
- Process.kill(:INT, @pid) if @pid
27
+ Process.kill(:INT, @pid)
28
28
  Process.wait(@pid)
29
29
  rescue Errno::ECHILD, Errno::ESRCH
30
30
  end
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "open3"
4
+
3
5
  module StripeCLI
4
6
  def self.signing_secret(api_key)
5
- secret = `#{executable} listen --api-key "#{api_key}" --print-secret`.chomp
6
- return nil unless $?.success?
7
- secret unless secret.empty?
7
+ secret, status = Open3.capture2(executable, "listen", "--api-key", api_key.to_s, "--print-secret", err: File::NULL)
8
+ secret.chomp if status.success? && !secret.strip.empty?
8
9
  rescue
9
10
  nil
10
11
  end
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module StripeCLI
2
- # constants describing the upstream tailwindcss project
4
+ # constants describing the upstream stripe/stripe-cli project
3
5
  module Upstream
4
- VERSION = "1.30.0"
6
+ VERSION = "1.54.1"
5
7
 
6
8
  # rubygems platform name => upstream release filename
7
9
  NATIVE_PLATFORMS = {
8
10
  "arm64-darwin" => "stripe_#{VERSION}_mac-os_arm64.tar.gz",
9
- "arm64-linux" => "stripe_#{VERSION}_linux_arm64.tar.gz",
11
+ "aarch64-linux" => "stripe_#{VERSION}_linux_arm64.tar.gz",
10
12
  "x86_64-darwin" => "stripe_#{VERSION}_mac-os_x86_64.tar.gz",
11
13
  "x86_64-linux" => "stripe_#{VERSION}_linux_x86_64.tar.gz"
12
14
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StripeCLI
4
- VERSION = "1.30.0"
4
+ VERSION = "1.54.1"
5
5
  end
data/lib/stripe_cli.rb CHANGED
@@ -16,10 +16,6 @@ module StripeCLI
16
16
  class ExecutableNotFoundException < StandardError
17
17
  end
18
18
 
19
- # raised when STRIPE_CLI_INSTALL_DIR does not exist
20
- class DirectoryNotFoundException < StandardError
21
- end
22
-
23
19
  class << self
24
20
  def platform
25
21
  [ :cpu, :os ].map { |m| Gem::Platform.local.send(m) }.join("-")
@@ -28,9 +24,8 @@ module StripeCLI
28
24
  def executable(exe_path: DEFAULT_DIR)
29
25
  if StripeCLI::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), GEM_NAME) }
30
26
  raise UnsupportedPlatformException, <<~MESSAGE
31
- #{GEM_NAME} does not support the #{platform} platform
32
- See https://github.com/flavorjones/tailwindcss-ruby#using-a-local-installation-of-tailwindcss
33
- for more details.
27
+ #{GEM_NAME} does not support the #{platform} platform.
28
+ Install the Stripe CLI another way: https://docs.stripe.com/stripe-cli#install
34
29
  MESSAGE
35
30
  end
36
31
 
@@ -55,9 +50,7 @@ module StripeCLI
55
50
  See `bundle lock --help` output for details.
56
51
 
57
52
  If you're still seeing this message after taking those steps, try running
58
- `bundle config` and ensure `force_ruby_platform` isn't set to `true`. See
59
- https://github.com/flavorjones/tailwindcss-ruby#check-bundle_force_ruby_platform
60
- for more details.
53
+ `bundle config` and ensure `force_ruby_platform` isn't set to `true`.
61
54
  MESSAGE
62
55
  end
63
56
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe-cli-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.30.0
4
+ version: 1.54.1
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Zacharias Knudsen
@@ -74,7 +74,7 @@ licenses:
74
74
  - MIT
75
75
  metadata:
76
76
  source_code_uri: https://github.com/zachasme/stripe-cli-ruby
77
- changelog_uri: https://github.com/zachasme/stripe-cli-ruby/blob/main/CHANGELOG.md
77
+ changelog_uri: https://github.com/zachasme/stripe-cli-ruby/releases
78
78
  rubygems_mfa_required: 'true'
79
79
  rdoc_options: []
80
80
  require_paths:
@@ -83,14 +83,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
83
  requirements:
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
- version: 3.1.0
86
+ version: 3.2.0
87
87
  required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - ">="
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubygems_version: 3.6.9
93
+ rubygems_version: 4.0.20
94
94
  specification_version: 4
95
95
  summary: A self-contained `stripe` executable.
96
96
  test_files: []