ical_importer 0.1.0 → 0.1.1
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.
    
        data/lib/ical_importer/parser.rb
    CHANGED
    
    | 
         @@ -83,14 +83,14 @@ module IcalImporter 
     | 
|
| 
       83 
83 
     | 
    
         
             
                    ::Timeout::timeout(@timeout) do
         
     | 
| 
       84 
84 
     | 
    
         
             
                      open prepped_uri(protocol), "r:UTF-8"
         
     | 
| 
       85 
85 
     | 
    
         
             
                    end
         
     | 
| 
       86 
     | 
    
         
            -
                  rescue
         
     | 
| 
      
 86 
     | 
    
         
            +
                  rescue StandardError
         
     | 
| 
       87 
87 
     | 
    
         
             
                    return open_ical 'https' if protocol == 'http'
         
     | 
| 
       88 
88 
     | 
    
         
             
                    nil
         
     | 
| 
       89 
89 
     | 
    
         
             
                  end
         
     | 
| 
       90 
90 
     | 
    
         
             
                end
         
     | 
| 
       91 
91 
     | 
    
         | 
| 
       92 
92 
     | 
    
         
             
                def prepped_uri(protocol)
         
     | 
| 
       93 
     | 
    
         
            -
                  uri = url.strip.gsub( 
     | 
| 
      
 93 
     | 
    
         
            +
                  uri = url.strip.gsub(/\A([Ww]ebcal|https?):/, "#{protocol}:")
         
     | 
| 
       94 
94 
     | 
    
         
             
                  uri = begin
         
     | 
| 
       95 
95 
     | 
    
         
             
                          URI.unescape(uri)
         
     | 
| 
       96 
96 
     | 
    
         
             
                        rescue URI::InvalidURIError
         
     | 
| 
         @@ -172,6 +172,15 @@ module IcalImporter 
     | 
|
| 
       172 
172 
     | 
    
         
             
                    end
         
     | 
| 
       173 
173 
     | 
    
         
             
                  end
         
     | 
| 
       174 
174 
     | 
    
         | 
| 
      
 175 
     | 
    
         
            +
                  describe "http" do
         
     | 
| 
      
 176 
     | 
    
         
            +
                    let(:base_url) { "://some_url" }
         
     | 
| 
      
 177 
     | 
    
         
            +
                    let(:https_url) { "https#{base_url}" }
         
     | 
| 
      
 178 
     | 
    
         
            +
                    let(:url) { "http#{base_url}" }
         
     | 
| 
      
 179 
     | 
    
         
            +
                    it "attempt https when http fails" do
         
     | 
| 
      
 180 
     | 
    
         
            +
                      subject.send(:prepped_uri, 'https').should == https_url
         
     | 
| 
      
 181 
     | 
    
         
            +
                    end
         
     | 
| 
      
 182 
     | 
    
         
            +
                  end
         
     | 
| 
      
 183 
     | 
    
         
            +
             
     | 
| 
       175 
184 
     | 
    
         
             
                  describe "webcal" do
         
     | 
| 
       176 
185 
     | 
    
         
             
                    let(:base_url) { "://some_url" }
         
     | 
| 
       177 
186 
     | 
    
         
             
                    let(:http_url) { "http#{base_url}" }
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: ical_importer
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.1
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2013- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2013-10-17 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: activesupport
         
     | 
| 
         @@ -157,12 +157,18 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       157 
157 
     | 
    
         
             
              - - ! '>='
         
     | 
| 
       158 
158 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       159 
159 
     | 
    
         
             
                  version: '0'
         
     | 
| 
      
 160 
     | 
    
         
            +
                  segments:
         
     | 
| 
      
 161 
     | 
    
         
            +
                  - 0
         
     | 
| 
      
 162 
     | 
    
         
            +
                  hash: -4537980247240833062
         
     | 
| 
       160 
163 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       161 
164 
     | 
    
         
             
              none: false
         
     | 
| 
       162 
165 
     | 
    
         
             
              requirements:
         
     | 
| 
       163 
166 
     | 
    
         
             
              - - ! '>='
         
     | 
| 
       164 
167 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       165 
168 
     | 
    
         
             
                  version: '0'
         
     | 
| 
      
 169 
     | 
    
         
            +
                  segments:
         
     | 
| 
      
 170 
     | 
    
         
            +
                  - 0
         
     | 
| 
      
 171 
     | 
    
         
            +
                  hash: -4537980247240833062
         
     | 
| 
       166 
172 
     | 
    
         
             
            requirements: []
         
     | 
| 
       167 
173 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       168 
174 
     | 
    
         
             
            rubygems_version: 1.8.24
         
     |