betlinks 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/betlinks/version.rb +1 -1
  2. data/lib/betlinks.rb +25 -23
  3. metadata +2 -2
@@ -1,3 +1,3 @@
1
1
  module Betlinks
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/betlinks.rb CHANGED
@@ -6,42 +6,44 @@ module Betlinks
6
6
  def betlinks_init
7
7
  @records = []
8
8
  @current_record = 0
9
- @lang_map['BETLINKS_СЧИТАТЬ'] = "data"
10
- @lang_map['betlinks_данные'] = '@records'
9
+ @lang_map['БЛ_ВИЛКА'] = "bl_data"
10
+ @lang_map['бл_данные'] = '@records'
11
11
  end
12
12
 
13
- def data(path)
13
+ def bl_data(path)
14
14
  @current_record = 0 if @current_record == @records.length
15
- read_data(path) if @current_record == 0
15
+ bl_read_data(path) if @current_record == 0
16
16
  result = @records[@current_record]
17
17
  @current_record += 1
18
18
  return result
19
19
  end
20
20
 
21
- def read_data(path)
21
+ def bl_read_data(path)
22
22
  data = File.open(path, "r").read
23
23
  forks = data.split(/^\=.*?\n/)
24
24
  forks.each do |f|
25
25
  next if f.strip.empty?
26
26
  @records << {
27
- game: "'#{f.scan(/\d{2}\:\d{2}\.\ (.*?)\:/).flatten(1)[0]}'",
28
- percent: f.scan(/\:\ (.*?)\%/).flatten(1)[0].gsub(',','.'),
29
- date: "'#{f.scan(/(\d{1,2}[^.].*?)\ в\ \d{2}\:\d{2}/).flatten(1)[0]}'",
30
- time: "'#{f.scan(/в\ (\d{2}\:\d{2})/).flatten(1)[0]}'",
31
- b1: {
32
- name: "'#{f.scan(/^1\.\ (.*?);\ /).flatten(1)[0]}'",
33
- type: "'#{f.scan(/^1\..*?ставка\ (.*?)\;/).flatten(1)[0]}'",
34
- coef: f.scan(/^1\..*?коэф\.\ (.*?)\(/).flatten(1)[0].gsub(',','.'),
35
- kind: "'#{f.scan(/^1\..*\((.*?)\/\//).flatten(1)[0]}'",
36
- game: "'#{f.scan(/^1\..*?\/\/\ (.*?)\)/).flatten(1)[0]}'",
37
- link: "'#{f.scan(/^1\..*\n(http.*?)$/).flatten(1)[0]}'"},
38
- b2: {
39
- name: "'#{f.scan(/^2\.\ (.*?);\ /).flatten(1)[0]}'",
40
- type: "'#{f.scan(/^2\..*?ставка\ (.*?)\;/).flatten(1)[0]}'",
41
- coef: f.scan(/^2\..*?коэф\.\ (.*?)\(/).flatten(1)[0].gsub(',','.'),
42
- kind: "'#{f.scan(/^2\..*\((.*?)\/\//).flatten(1)[0]}'",
43
- game: "'#{f.scan(/^2\..*?\/\/\ (.*?)\)/).flatten(1)[0]}'",
44
- link: "'#{f.scan(/^2\..*\n(http.*?)$/).flatten(1)[0]}'"}
27
+ 'игра' => f.scan(/\d{2}\:\d{2}\.\ (.*?)\:/).flatten(1)[0],
28
+ 'прибыль' => f.scan(/\:\ (.*?)\%/).flatten(1)[0].gsub(',','.').to_f,
29
+ 'дата' => f.scan(/(\d{1,2}[^.].*?)\ в\ \d{2}\:\d{2}/).flatten(1)[0],
30
+ 'время' => f.scan(/в\ (\d{2}\:\d{2})/).flatten(1)[0],
31
+ 'брокер_1' => {
32
+ 'имя' => f.scan(/^1\.\ (.*?);\ /).flatten(1)[0],
33
+ 'вид_ставки' => f.scan(/^1\..*?ставка\ (.*?)\;/).flatten(1)[0],
34
+ 'коэф' => f.scan(/^1\..*?коэф\.\ (.*?)\(/).flatten(1)[0].gsub(',','.').to_f,
35
+ 'вид_спорта' => f.scan(/^1\..*\((.*?)\/\//).flatten(1)[0],
36
+ 'игра' => f.scan(/^1\..*?\/\/\ (.*?)\)/).flatten(1)[0],
37
+ 'ссылка' => f.scan(/^1\..*\n(http.*?)$/).flatten(1)[0].strip!
38
+ },
39
+ 'брокер_2' => {
40
+ 'имя' => f.scan(/^2\.\ (.*?);\ /).flatten(1)[0],
41
+ 'вид_ставки' => f.scan(/^2\..*?ставка\ (.*?)\;/).flatten(1)[0],
42
+ 'коэф' => f.scan(/^2\..*?коэф\.\ (.*?)\(/).flatten(1)[0].gsub(',','.').to_f,
43
+ 'вид_спорта' => f.scan(/^2\..*\((.*?)\/\//).flatten(1)[0],
44
+ 'игра' => f.scan(/^2\..*?\/\/\ (.*?)\)/).flatten(1)[0],
45
+ 'ссылка' => f.scan(/^2\..*\n(http.*?)/).flatten(1)[0].strip!
46
+ }
45
47
  }
46
48
  end
47
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: betlinks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
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: 2012-09-06 00:00:00.000000000 Z
12
+ date: 2012-09-07 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Plugin for bets
15
15
  email: