jalik 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -3
- data.tar.gz.sig +0 -0
- data/README.md +12 -0
- data/jalik.gemspec +1 -1
- data/lib/gem-version.rb +1 -1
- data/lib/jalik/parser.rb +14 -2
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a92e0b65ce6709fdc29a7bc9ef5b5f5fc1377fe8
|
4
|
+
data.tar.gz: d5aa911037db6a20827e6ea95e05407013bd91c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f57f69cebd98c569cf5ffa4294544682a3d793c0c6f8259e1a25fab310729b0daf26c495720efab8a3f40c43f1150e315776e2b52c2b53d4878ed4603d8626a5
|
7
|
+
data.tar.gz: a917a527026923f8ac90de2bc7ec10daf18b274e0ca524cc4e54d8a08751fd96d9885996f5d219f0545d915368799a305ca5ae0212d5d407b6159c8b61449f49
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
�
|
2
|
-
�J
|
3
|
-
���}6���)���>���+1���:��\�
|
1
|
+
D��)r�=�ժM���Y+��ݞ���O̗��Pl�8)K̵������|��)V���4����}3c�S�"^F"�Yv)������#e�a�(mC/����)j�Bm�P�=)�3�l�[�OCpJ��+�)'��
|
2
|
+
v�6�K�J�ZP���!���/F������g�$T+����:��ÿĝ^�<����ҮA��#=�d�O����8տ&�ף6����[���1�z��O]1��P�I�u#�X���wfw��V�-�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -8,3 +8,15 @@ Last Stable Gem
|
|
8
8
|
On day, I discover a "onclik jalik" btn on the web. It was ugly and bad. I wrote this gem to parse it.
|
9
9
|
It is pointless but I liked it.
|
10
10
|
|
11
|
+
# How to use
|
12
|
+
|
13
|
+
Install ruby (>= 2.0 if possible), and rubygems.
|
14
|
+
Then, use ``gem install jalik``
|
15
|
+
|
16
|
+
In your ruby code, try :
|
17
|
+
```ruby
|
18
|
+
require 'jalik'
|
19
|
+
|
20
|
+
puts Jalik.parse "jalik('this[*]url[*]to[*]parse[#][;]');"
|
21
|
+
```
|
22
|
+
|
data/jalik.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
"Rakefile",
|
19
19
|
"jalik.gemspec",
|
20
20
|
]
|
21
|
-
s.homepage = "https://github.com/
|
21
|
+
s.homepage = "https://github.com/pouleta/jalik"
|
22
22
|
s.license = "GNU/GPLv3"
|
23
23
|
s.cert_chain = ['certs/poulet_a.pem']
|
24
24
|
s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
|
data/lib/gem-version.rb
CHANGED
data/lib/jalik/parser.rb
CHANGED
@@ -3,9 +3,21 @@
|
|
3
3
|
module Jalik
|
4
4
|
|
5
5
|
# @param jalik_value [String] a jalik link like "jalik('details[!]ancien[*]presbytere[*][#][;]');"
|
6
|
+
# @param proto [String] "http://" or "https://"
|
7
|
+
# @param host [String] site address (domain or ip)
|
6
8
|
# @return [String]
|
7
|
-
def self.parse(jalik_value)
|
8
|
-
|
9
|
+
def self.parse(jalik_value, proto="http://", host="127.0.0.1")
|
10
|
+
jalik_value = jalik_value.to_s
|
11
|
+
jalik_value.gsub!(/jalik\('(.*)'\);/, '\1')
|
12
|
+
jalik_value.gsub!('[x]', proto.to_s + host.to_s);
|
13
|
+
jalik_value.gsub!('[h]', host.to_s);
|
14
|
+
jalik_value.gsub!('[|]','/');
|
15
|
+
jalik_value.gsub!('[#]', '.');
|
16
|
+
jalik_value.gsub!('[!]', '-');
|
17
|
+
jalik_value.gsub!('[*]','+');
|
18
|
+
jalik_value.gsub!('[;]', 'html');
|
19
|
+
jalik_value.gsub!('[@]', 'php');
|
20
|
+
return jalik_value
|
9
21
|
end
|
10
22
|
|
11
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jalik
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- poulet_a
|
@@ -52,7 +52,7 @@ files:
|
|
52
52
|
- lib/gem-version.rb
|
53
53
|
- lib/jalik.rb
|
54
54
|
- lib/jalik/parser.rb
|
55
|
-
homepage: https://github.com/
|
55
|
+
homepage: https://github.com/pouleta/jalik
|
56
56
|
licenses:
|
57
57
|
- GNU/GPLv3
|
58
58
|
metadata: {}
|
metadata.gz.sig
CHANGED
Binary file
|