mdurl-rb 1.0.0.1 → 1.0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfcbf24da2273d2580682fa690c821fc69b23c53
4
- data.tar.gz: 87074f454da478a788227b689d89a6d6be676a60
3
+ metadata.gz: 2603c6c8889dcb583ac0d890e104794fa3aab7cc
4
+ data.tar.gz: b5b294a2aff198bb6236b470cd118caa7198fc91
5
5
  SHA512:
6
- metadata.gz: 347a0b6b36a1802ba392b3a8d01047b94517162fc418162f62b6040126d681e18b12797a6ef8d3a309ba23a38aec5498429174017c0c4aa222000d1efa4d6d1a
7
- data.tar.gz: ce81db1bde29553a0776ae967523657e94c38fafec405f76fe8f6d3b0b66a9f6cedfd2f5dcdb91c54671892f6d2f3c2c98acf862853274ef65602ba33919897e
6
+ metadata.gz: a64d811eb4364669f607e121f59456f8be5a9646858b678be838f8f40c8ba4111c1de15d89372e92cdaa87fde053a13aa17883ba5aeeb9707a90437ba5e71a48
7
+ data.tar.gz: 0a894850e135ce81b6f68dbeffb988fe9fc25851f7585731361a2c45e7c352014602f97320ee0d87896252ac3be0c95d6670aa8edcf9be73484ad77a60c68e64
@@ -0,0 +1,25 @@
1
+ # Borrowed this from motion-support 0.2.6, as it's all we need. Don't want the
2
+ # dependency
3
+ #------------------------------------------------------------------------------
4
+ # This is a very small part of the CGI class, borrowed from the Rubinius sources
5
+ class CGI
6
+ @@accept_charset="UTF-8" unless defined?(@@accept_charset)
7
+ # URL-encode a string.
8
+ # url_encoded_string = CGI::escape("'Stop!' said Fred")
9
+ # # => "%27Stop%21%27+said+Fred"
10
+ def CGI::escape(string)
11
+ string.gsub(/([^ a-zA-Z0-9_.-]+)/) do
12
+ '%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
13
+ end.tr(' ', '+')
14
+ end
15
+
16
+ # URL-decode a string with encoding(optional).
17
+ # string = CGI::unescape("%27Stop%21%27+said+Fred")
18
+ # # => "'Stop!' said Fred"
19
+ def CGI::unescape(string,encoding=@@accept_charset)
20
+ str=string.tr('+', ' ').force_encoding(Encoding::ASCII_8BIT).gsub(/((?:%[0-9a-fA-F]{2})+)/) do
21
+ [$1.delete('%')].pack('H*')
22
+ end.force_encoding(encoding)
23
+ str.valid_encoding? ? str : str.force_encoding(string.encoding)
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  module MDUrl
2
2
 
3
- VERSION = '1.0.0.1'
3
+ VERSION = '1.0.0.3'
4
4
 
5
5
  end
data/lib/mdurl-rb.rb CHANGED
@@ -6,8 +6,7 @@ if defined?(Motion::Project::Config)
6
6
  Motion::Project::App.setup do |app|
7
7
  app.files.unshift(Dir.glob(File.join(lib_dir_path, "mdurl-rb/**/*.rb")))
8
8
  end
9
-
10
- require 'motion-support'
9
+
11
10
  else
12
11
 
13
12
  require 'mdurl-rb/parse'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdurl-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.1
4
+ version: 1.0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Walker
@@ -10,22 +10,8 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-03-26 00:00:00.000000000 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: motion-support
17
- requirement: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - "~>"
20
- - !ruby/object:Gem::Version
21
- version: 0.2.6
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - "~>"
27
- - !ruby/object:Gem::Version
28
- version: 0.2.6
13
+ date: 2015-03-27 00:00:00.000000000 Z
14
+ dependencies: []
29
15
  description: Ruby version of MDUrl for motion-markdown-it for use with Ruby and RubyMotion
30
16
  email: github@digitalmoksha.com
31
17
  executables: []
@@ -34,6 +20,7 @@ extra_rdoc_files: []
34
20
  files:
35
21
  - README.md
36
22
  - lib/mdurl-rb.rb
23
+ - lib/mdurl-rb/cgi.rb
37
24
  - lib/mdurl-rb/decode.rb
38
25
  - lib/mdurl-rb/encode.rb
39
26
  - lib/mdurl-rb/format.rb