feduxorg / proxy_pac_rb

proxy_pac _rb is a gem to test, compress, lint, and parse proxy auto-config files
https://github.com/fedux-org/proxy_pac_rb
MIT License
3 stars 2 forks source link

dependency on activesupport 4.x is a blocker for rails 5.x #2

Open net1957 opened 7 years ago

net1957 commented 7 years ago

on a new project on rails 5.0.2, this gem install only in version 0.5.3

on activesupport 5.0.2 it seems that the required files exists.

Perhaps you could relax on activesupport version ?

📝

net1957 commented 7 years ago

First problem is due to rake 11.x so i added in the Rakefile

# temp fix for NoMethodError: undefined method `last_comment'
# remove when fixed in Rake 11.x
# see http://stackoverflow.com/questions/35893584/nomethoderror-undefined-method-last-comment-after-upgrading-to-rake-11
module TempFixForRakeLastComment
   def last_comment
     last_description
   end
 end
Rake::Application.send :include, TempFixForRakeLastComment
### end of tempfix

I did modify proxy_pac_rb.gemspec:

  spec.add_runtime_dependency 'activesupport', '>=4.1', '<5.1'

and i tried with activesupport 5.0.2 it's working, but for testing i get

  middleman (~> 4.1) was resolved to 4.1.0, which depends on
     middleman-core (= 4.1.0) was resolved to 4.1.0, which depends on
       activesupport (~> 4.2)``

I relaxed version of uglifier and middleman; I get activesupport 5.02, middleman 4.2.1 and uglifier 3.2. but some test fails:

  1) ProxyPacRb::Rack::ProxyPacCompressor when valid proxy pac is given should eq "function FindProxyForURL(url, host) {\n    return \"DIRECT\";\n}"
     Failure/Error: it { expect(body).to eq compressed_content }

       expected: "function FindProxyForURL(url, host) {\n    return \"DIRECT\";\n}"
            got: "function FindProxyForURL() {\n    return \"DIRECT\";\n}"

       (compared using ==)

       Diff:
       @@ -1,4 +1,4 @@
       -function FindProxyForURL(url, host) {
       +function FindProxyForURL() {
            return "DIRECT";
        }

     # ./spec/rack/proxy_pac_compressor_spec.rb:36:in `block (3 levels) in <top (required)>'
     # /var/lib/gems/2.3.0/gems/aruba-0.14.2/lib/aruba/rspec.rb:23:in `block (2 levels) in <top (required)>'

  2) ProxyPacRb::ProxyPacCompressor#modify when string contains white paces should receive content=("function FindProxyForURL(url, host) {\n    return \"DIRECT\";\n}") 1 time
     Failure/Error: proxy_pac.content = Uglifier.new(options).compile(proxy_pac.content)

       #<InstanceDouble(ProxyPac::ProxyPacFile) (anonymous)> received :content= with unexpected arguments
         expected: ("function FindProxyForURL(url, host) {\n    return \"DIRECT\";\n}")
              got: ("function FindProxyForURL() {\n    return \"DIRECT\";\n}")
       Diff:
       @@ -1,4 +1,4 @@
       -function FindProxyForURL(url, host) {
       +function FindProxyForURL() {
            return "DIRECT";
        }

     # ./lib/proxy_pac_rb/proxy_pac_compressor.rb:65:in `compress'
     # ./spec/api/proxy_pac_compressor_spec.rb:30:in `block (4 levels) in <top (required)>'
     # /var/lib/gems/2.3.0/gems/aruba-0.14.2/lib/aruba/rspec.rb:23:in `block (2 levels) in <top (required)>'

 132/132 |=============================================================== 100 ===============================================================>| Time: 00:00:00

Changing in ProxyPacRb::ProxyPacCompressor options keep_fargs to true solve the issue the bundle is:

  * activesupport (5.0.2)
  * addressable (2.5.1)
  * aruba (0.14.2)
  * ast (2.3.0)
  * awesome_print (1.7.0)
  * backports (3.8.0)
  * blockenspiel (0.5.0)
  * builder (3.2.3)
  * bundler (1.14.6)
  * byebug (9.0.6)
  * childprocess (0.5.9)
  * coderay (1.1.1)
  * coffee-script (2.4.1)
  * coffee-script-source (1.12.2)
  * command_exec (0.2.0)
  * compass-import-once (1.0.5)
  * concurrent-ruby (1.0.5)
  * contracts (0.13.0)
  * coveralls (0.8.21)
  * crack (0.4.3)
  * cucumber (2.4.0)
  * cucumber-core (1.5.0)
  * cucumber-wire (0.0.1)
  * diff-lcs (1.3)
  * docile (1.1.5)
  * dotenv (2.2.1)
  * erubis (2.7.0)
  * excon (0.45.4)
  * execjs (2.7.0)
  * fast_blank (1.0.0)
  * fastimage (2.1.0)
  * fedux_org-stdlib (0.11.18)
  * ffi (1.9.18)
  * filegen (0.4.3)
  * foreman (0.84.0)
  * fuubar (2.2.0)
  * gherkin (4.1.3)
  * github-markup (1.6.0)
  * haml (5.0.1)
  * hamster (3.0.0)
  * hashdiff (0.3.4)
  * hashie (3.5.5)
  * httparty (0.14.0)
  * i18n (0.7.0)
  * inch (0.7.1)
  * json (2.1.0)
  * kramdown (1.13.2)
  * launchy (2.4.3)
  * libv8 (3.16.14.19)
  * license_finder (3.0.0)
  * listen (3.0.8)
  * memoist (0.15.0)
  * method_source (0.8.2)
  * middleman (4.2.1)
  * middleman-cli (4.2.1)
  * middleman-core (4.2.1)
  * minitest (5.10.1)
  * multi_json (1.12.1)
  * multi_test (0.1.2)
  * multi_xml (0.6.0)
  * mustermann (1.0.0)
  * padrino-helpers (0.13.3.3)
  * padrino-support (0.13.3.3)
  * parallel (1.11.2)
  * parser (2.4.0.0)
  * powerpack (0.1.1)
  * proxy_pac_rb (2.3.0)
  * pry (0.10.4)
  * pry-byebug (3.4.2)
  * pry-doc (0.9.0)
  * public_suffix (2.0.5)
  * rack (2.0.1)
  * rack-protection (2.0.0)
  * rack-test (0.6.3)
  * rainbow (2.2.2)
  * rake (12.0.0)
  * rb-fsevent (0.9.8)
  * rb-inotify (0.9.8)
  * redcarpet (3.4.0)
  * ref (2.0.0)
  * rspec (3.6.0)
  * rspec-core (3.6.0)
  * rspec-expectations (3.6.0)
  * rspec-mocks (3.6.0)
  * rspec-support (3.6.0)
  * rubocop (0.48.1)
  * ruby-prof (0.16.2)
  * ruby-progressbar (1.8.1)
  * rubyzip (1.2.1)
  * safe_yaml (1.0.4)
  * sass (3.4.23)
  * servolux (0.13.0)
  * simplecov (0.14.1)
  * simplecov-html (0.10.0)
  * sinatra (2.0.0)
  * slop (3.6.0)
  * smart_colored (1.1.1)
  * sparkr (0.4.1)
  * temple (0.8.0)
  * term-ansicolor (1.6.0)
  * therubyracer (0.12.3)
  * therubyrhino (2.0.4)
  * therubyrhino_jar (1.7.6)
  * thor (0.19.4)
  * thread_safe (0.3.6)
  * tilt (2.0.7)
  * tins (1.13.2)
  * tmrb (1.2.7)
  * travis-lint (2.0.0)
  * tzinfo (1.2.3)
  * uglifier (3.2.0)
  * unicode-display_width (1.2.1)
  * versionomy (0.5.0)
  * webmock (3.0.1)
  * with_env (1.1.0)
  * xml-simple (1.1.5)
  * yard (0.8.7.6)

What are the next steps to bring that in a new version? Regards.

I have a temporary fork on https://github.com/net1957/proxy_pac_rb with a rails5.0 branch

net1957 commented 7 years ago

replaced the rails5.0 branch with a rails5.1 one