Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.17.2 gem content is broken and not the same as the content of the v0.17.2 tag #681

Closed
rymai opened this issue Dec 16, 2019 · 5 comments
Closed

Comments

@rymai
Copy link

rymai commented Dec 16, 2019

It looks like the content if the v0.17.2 tag (https://github.com/jnunemaker/httparty/archive/v0.17.2.zip) isn't the same as when inspecting the 0.17.2 gem, especially for the https://github.com/jnunemaker/httparty/blob/v0.17.2/lib/httparty/module_inheritable_attributes.rb file. The file looks as follows in the gem:

module HTTParty
  class ModuleInheritableAttributes < Module #:nodoc:
    def initialize(*names)
      attr_accessor *names

      define_method :inherited do |subclass|
        names.each do |name|
          super(subclass)
          subclass.send(:"#{name}=", send(name))

          subclass.class_eval <<-RUBY
            def self.#{name}
              @#{name} = superclass.#{name}.merge(ModuleInheritableAttributes.hash_deep_dup(@#{name}))
            end

            def self.#{name}=(val)
              Thread["httparty_{name"]
            end
          RUBY
        end
      end
    end

    # borrowed from Rails 3.2 ActiveSupport
    def self.hash_deep_dup(hash)
      duplicate = hash.dup

      duplicate.each_pair do |key, value|
        if value.is_a?(Hash)
          duplicate[key] = hash_deep_dup(value)
        elsif value.is_a?(Proc)
          duplicate[key] = value.dup
        else
          duplicate[key] = value
        end
      end

      duplicate
    end
  end
end
@rymai
Copy link
Author

rymai commented Dec 16, 2019

@TheSmartnik Maybe you built the gem locally with in-progress code and mistakenly released it instead of the code tagged v0.17.2?

Quintasan added a commit to ApploverSoftware/android-ci that referenced this issue Dec 16, 2019
I appears that 0.17.2 contents do not match the code in repository jnunemaker/httparty#681
@tomdev
Copy link

tomdev commented Dec 16, 2019

Confirmed we're also running into issues with the 0.17.2 release.

@TheSmartnik
Copy link
Collaborator

@rymai Oh, sorry. My mistake. Thanks for bringing it up

@TheSmartnik
Copy link
Collaborator

@rymai @tomdev fixed

  1. Removed version 0.17.2 from rubygems
  2. Pushed a version 0.17.3

Again thanks for creating the issue and sorry for the inconvenience

@rymai
Copy link
Author

rymai commented Dec 16, 2019

No problem, this happens! Thanks for the reactivity!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants