Make note of upstream sha
when templated: 2add9da
(https://cln.sh/ETfqYT) and
the first commit sha
from templated new repo: 85f49ba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An error occurred while Layout/LineLength cop was inspecting /Users/peterberkenbosch/code/solidusio-contrib/solidus_affirm_v2/spec/views/spree/checkout/payment/affirm_v2_spec.rb:14:4. | |
can't modify frozen Array | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/mixin/check_line_breakable.rb:174:in `pop' | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/mixin/check_line_breakable.rb:174:in `process_args' | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/mixin/check_line_breakable.rb:47:in `extract_breakable_node' | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/layout/line_length.rb:102:in `check_for_breakable_node' | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/layout/line_length.rb:75:in `on_potential_breakable_node' | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/commissioner.rb:91:in `block (2 levels) in trigger_responding_cops' | |
/Users/peterberkenbo |
Do you see this error pushing to the hub from Heroku?
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:918:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
This indicates that ruby is unable to find the certification authority certificates. You can probably confirm this by setting the following in your code:
In this small guide I will share the setup I use to contribute to SpreeCommerce.
Disclaimer: This post contains some content written by me and others for the developer guides at SpreeCommerce.
Fork the repo the spree repository on github and clone the spree project on your local machine:
git clone YOUR-REPO-URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set = [1.1, 1.2, 0.85, 2.0, 1.3, 3.2] | |
geo_avg = (set.inject{|a,b| a*b}) ** (1.0/set.size) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initializer 'spree.register.calculators' do |app| | |
app.config.spree.calculators.shipping_methods << Spree::Calculator::Shipping::MyCalc | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::Promotion::Rules::User.class_eval do | |
def eligible?(order, options = {}) | |
user = order.user | |
promotion_count = Spree::Adjustment.promotion.where(source_id: Spree::Order.select(:id).where(user_id: user.id).collect(&:id) ).count | |
users.include?(user) && promotion_count == 0 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if rate.respond_to(:pickup_date) %> | |
<%= ship_form.text_field :pickup_date %> | |
<% end %> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- insert_before "[data-hook='taxon_products']" --> | |
<%=render_snippet('sample')%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compute(computable) | |
# Spree::LineItem -> :compute_line_item | |
computable_name = computable.class.name.demodulize.underscore | |
method = "compute_#{computable_name}".to_sym | |
calculator_class = self.class | |
begin | |
self.send(method, computable) | |
rescue NoMethodError | |
raise NotImplementedError, "Please implement '#{method}(#{computable_name})' in your calculator: #{calculator_class.name}" | |
end |
NewerOlder