jalik 1.0 → 1.1

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: 952e4e1636de7b158719a87e7f1fc168b2afb7ca
4
- data.tar.gz: 27f088b048ea94495609bdacd94f57385765e49a
3
+ metadata.gz: a92e0b65ce6709fdc29a7bc9ef5b5f5fc1377fe8
4
+ data.tar.gz: d5aa911037db6a20827e6ea95e05407013bd91c6
5
5
  SHA512:
6
- metadata.gz: 340841bde5053296a25e05c229fae8c2e7b65a26e65fcb624839d19dcb702ed38229f7c3f94b37ed5fa22e213ac816131eb62d5b995a6039574a34c45fb415f3
7
- data.tar.gz: 0a4962deaec2ebde522d2e7bbd745ac668f826091f7bb0c1242fba22f890e74651c5432ce140b5c335cf1db1e69d60e2e19a4b032778f33320fe322a49d73704
6
+ metadata.gz: f57f69cebd98c569cf5ffa4294544682a3d793c0c6f8259e1a25fab310729b0daf26c495720efab8a3f40c43f1150e315776e2b52c2b53d4878ed4603d8626a5
7
+ data.tar.gz: a917a527026923f8ac90de2bc7ec10daf18b274e0ca524cc4e54d8a08751fd96d9885996f5d219f0545d915368799a305ca5ae0212d5d407b6159c8b61449f49
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- E��?�qE Z��$lg�չ�tu'bG.�i��y
2
- �J᝜(J$���"���lp5���,ΩI���: ��Q䠈�m��+
3
- ���}6���)���>���+1���:��\�
1
+ D��)r�=�ժM���Y+��ݞ���O̗��Pl8)K̵������|��)V���4����}3cS�"^F"Yv )������#ea�(mC/����)j�Bm�P�=)�3�l�[�OCpJ��+�)'��
2
+ v6�K�J�ZP���!���/F������g�$T+����:� �ÿĝ^�<����ҮA��#=�dO����8տ&�ף6����[���1z��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/poulet_a/jalik"
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
@@ -1,5 +1,5 @@
1
1
  module Jalik
2
2
 
3
- VERSION = '1.0'
3
+ VERSION = '1.1'
4
4
 
5
5
  end
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
- return jalik_value.to_s.gsub("jalik('", "").gsub("');", "").gsub("[*]", "+").gsub("[#]", ".").gsub("[!]", "-").gsub("[;]", "html")
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.0'
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/poulet_a/jalik
55
+ homepage: https://github.com/pouleta/jalik
56
56
  licenses:
57
57
  - GNU/GPLv3
58
58
  metadata: {}
metadata.gz.sig CHANGED
Binary file