jekyll-rp_logs 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 974c0aa62a5a2ceab9fbf0790293b4b16e7c66a7
4
- data.tar.gz: 60b6f529206fcdcbc29d841a246955029448380b
3
+ metadata.gz: 0d8c0a7252b47e5aefb5b071f407a808f41e2064
4
+ data.tar.gz: e7b63efff53e6e868228b1d4643506e0f626e2a8
5
5
  SHA512:
6
- metadata.gz: 01e79a663db414f7e15eb978e911904966d490653a8b7de7e1f4a260b46d05e3dfc84019f0213312bdd53ae4d96bc2da4b4c4465bb45364900841d863776462c
7
- data.tar.gz: 402bfbd31196ffc7b6ed4b7922e8610f112626f0cb16409eba6746462cd8cefea2bd3dd51921dd0a27274cc770454119c0e145a28630efebac18f13a7d692583
6
+ metadata.gz: 2dbc869400c1019e19664bd71bd696ee4b0518ef3fc72ff1fffaad9e7c230e0c79c877ae4e7b6bd3a5126c9d72154d64d3f6f8df8a9dba9047773a8ed72e09a7
7
+ data.tar.gz: 98f500d4b8eac3aee521c30745d8b937ef95f673b63cdf2861bcdaef84cd831538c5afec2f7530ad3ae4f1bc26edea26677802b50267d05de4086ffd384eac27
@@ -57,8 +57,10 @@ $on-laptop: 800px;
57
57
 
58
58
  // Import partials from `sass_dir` (defaults to `_sass`)
59
59
  @import
60
+ "custom-vars",
60
61
  "base",
61
62
  "layout",
62
63
  "syntax-highlighting",
63
- "rp"
64
+ "rp",
65
+ "custom-rules"
64
66
  ;
data/README.md CHANGED
@@ -3,13 +3,18 @@
3
3
  ## Installation
4
4
 
5
5
  ### Bundler
6
- Add these lines to your application's Gemfile:
6
+ Create a file named Gemfile with the following contents:
7
7
 
8
8
  ```ruby
9
+ source 'https://rubygems.org'
10
+
9
11
  group :jekyll_plugins do
10
- gem 'jekyll-rp_logs'
12
+ gem "jekyll-rp_logs"
11
13
  end
12
14
  ```
15
+
16
+ (If you already have a Gemfile, just add the three group lines instead.)
17
+
13
18
  And then execute:
14
19
 
15
20
  $ bundle
@@ -5,7 +5,7 @@ module Jekyll
5
5
 
6
6
  # Add this class to the parsing dictionary
7
7
  FORMAT_STR = 'irssi-xchat'
8
- RpLogs::RpLogGenerator.add self
8
+ RpLogGenerator.add self
9
9
 
10
10
  # Stuff
11
11
  class << self
@@ -0,0 +1,54 @@
1
+ module Jekyll
2
+ module RpLogs
3
+
4
+ class MIRCParser < RpLogs::Parser
5
+
6
+ # Add this class to the parsing dictionary
7
+ FORMAT_STR = 'MIRC'
8
+ RpLogGenerator.add self
9
+
10
+ # Stuff
11
+ class << self
12
+ MODE = /([+%@&~!]?)/
13
+ NICK = /([\w\-\\\[\]\{\}\^\`\|]+)/
14
+ DATE_REGEXP = /(\d\d \d\d \d\d\[\d\d:\d\d\])/ #Remember to change this for your date format
15
+ #For example, this regex is for, mm dd yy[HH:nn] or 06 14 15[18:48]
16
+ #The default mirc date format is HH:nn
17
+
18
+ #Also make sure to change this - http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html
19
+ TIMESTAMP_FORMAT = '%m %d %y[%H:%M]'
20
+ #If you are using the default mirc format, this should be '[%H:%M]'
21
+
22
+ FLAGS = /((?:![A-Z]+ )*)/
23
+ # Crappy but works
24
+ # The ()?((?=\d{4})(\d\d))? bit of code is to remove the  and two random numbers in front of lines.
25
+ #This assumes that you have a two digit date code stating your time stamp.
26
+ USER_AT_HOST = /\(\w+@[^)]+\)/
27
+ JUNK = /()?((?=\d{4})(\d\d))?#{DATE_REGEXP} \* #{MODE}#{NICK} (sets mode:|is now known as|(#{USER_AT_HOST} (has joined|Quit|has left))).*$/
28
+ EMOTE = /^#{FLAGS}()?((?=\d{4})(\d\d))?#{DATE_REGEXP}\s\*\s#{MODE}#{NICK}\s+([^\n]*)$/
29
+ TEXT = /^#{FLAGS}()?((?=\d{4})(\d\d))?#{DATE_REGEXP}\s<#{MODE}#{NICK}>\s([^\n]*)$/
30
+
31
+ def parse_line(line, options = {})
32
+ case line
33
+ when JUNK
34
+ nil
35
+ when EMOTE
36
+ date = DateTime.strptime($5, TIMESTAMP_FORMAT)
37
+ Parser::LogLine.new(date, options, sender: $7, contents: $8, \
38
+ flags: $1, type: :rp)
39
+ when TEXT
40
+ date = DateTime.strptime($5, TIMESTAMP_FORMAT)
41
+ mode = if $6 != '' then $6 else ' ' end
42
+ Parser::LogLine.new(date, options, sender: $7, contents: $8, \
43
+ flags: $1, type: :ooc, mode: mode)
44
+ else
45
+ # Only put text and emotes in the log
46
+ nil
47
+ end
48
+ end
49
+ end
50
+
51
+ end
52
+
53
+ end
54
+ end
@@ -0,0 +1,56 @@
1
+ module Jekyll
2
+ module RpLogs
3
+
4
+ class Skype12Parser < RpLogs::Parser #This is for the date format [6/12/2015 7:01:45 PM]
5
+
6
+ # Add this class to the parsing dictionary
7
+ FORMAT_STR = 'Skype12'
8
+ RpLogGenerator.add self
9
+
10
+ # Stuff
11
+ class << self
12
+ NICK = /([\w\-\\\[\]\{\}\^\`\|\s\'\)\(]+)/
13
+ DATE_REGEXP = /(\[\d?\d\/\d?\d\/\d\d\d\d\s\d?\d\:\d\d\:\d\d\s(AM|PM)\])/
14
+ FLAGS = /((?:![A-Z]+ )*)/
15
+ BAD_STUFF = /[^a-zA-Z\-\_]/
16
+
17
+ # Crappy but works
18
+ USER_AT_HOST = /\(\w+@[^)]+\)/
19
+ #Not needed? JUNK = /#{DATE_REGEXP} \* #{MODE}#{NICK} (sets mode:|is now known as|(#{USER_AT_HOST} (has joined|Quit|has left))).*$/
20
+ EMOTE = /^#{FLAGS}#{DATE_REGEXP}\s#{NICK}:\s(\4)([^\n]*)$/
21
+ TEXT = /^#{FLAGS}#{DATE_REGEXP}\s#{NICK}:\s([^\n]*)$/
22
+
23
+ TIMESTAMP_FORMAT = '[%m/%d/%Y %I:%M:%S %p]'
24
+
25
+ def parse_line(line, options = {})
26
+ case line
27
+ #when JUNK
28
+ #nil
29
+ when EMOTE
30
+ print "1"
31
+ date = DateTime.strptime($2, TIMESTAMP_FORMAT)
32
+ contents = $6
33
+ flags = $1
34
+ sendername = $4.tr(' ', '-').gsub(BAD_STUFF, "")
35
+ Parser::LogLine.new(date, options, sender: sendername, contents: contents, \
36
+ flags: flags, type: :rp)
37
+ when TEXT
38
+ print "2"
39
+ date = DateTime.strptime($2, TIMESTAMP_FORMAT)
40
+ contents = $5
41
+ flags = $1
42
+ sendername = $4.tr(' ', '-').gsub(BAD_STUFF, "")
43
+ Parser::LogLine.new(date, options, sender: sendername, contents: contents, \
44
+ flags: flags, type: :ooc)
45
+ else
46
+ print "3"
47
+ # Only put text and emotes in the log
48
+ nil
49
+ end
50
+ end
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+ end
@@ -0,0 +1,52 @@
1
+ module Jekyll
2
+ module RpLogs
3
+
4
+ class Skype24Parser < RpLogs::Parser #This is for the date format [05.06.15 10:58:47]
5
+
6
+ # Add this class to the parsing dictionary
7
+ FORMAT_STR = 'Skype24'
8
+ RpLogGenerator.add self
9
+
10
+ # Stuff
11
+ class << self
12
+ NICK = /([\w\-\\\[\]\{\}\^\`\|\s\']+)/
13
+ DATE_REGEXP = /(\[\d\d.\d\d.\d\d\s\d\d\:\d\d\:\d\d\])/
14
+ FLAGS = /((?:![A-Z]+ )*)/
15
+ BAD_STUFF = /[^a-zA-Z\-\_]/
16
+ # Crappy but works
17
+ USER_AT_HOST = /\(\w+@[^)]+\)/
18
+ #Not needed? JUNK = /#{DATE_REGEXP} \* #{MODE}#{NICK} (sets mode:|is now known as|(#{USER_AT_HOST} (has joined|Quit|has left))).*$/
19
+ EMOTE = /^#{FLAGS}#{DATE_REGEXP}\s#{NICK}:\s(\3)([^\n]*)$/
20
+ TEXT = /^#{FLAGS}#{DATE_REGEXP}\s#{NICK}:\s([^\n]*)$/
21
+
22
+ TIMESTAMP_FORMAT = '[%d.%m.%y %H:%M:%S]'
23
+
24
+ def parse_line(line, options = {})
25
+ case line
26
+ # when JUNK
27
+ # nil
28
+ when EMOTE
29
+ date = DateTime.strptime($2, TIMESTAMP_FORMAT)
30
+ contents = $5
31
+ flags = $1
32
+ sendername = $3.tr(' ', '-').gsub(BAD_STUFF, "")
33
+ Parser::LogLine.new(date, options, sender: sendername, contents: contents, \
34
+ flags: flags, type: :rp)
35
+ when TEXT
36
+ date = DateTime.strptime($2, TIMESTAMP_FORMAT)
37
+ contents = $4
38
+ flags = $1
39
+ sendername = $3.tr(' ', '-').gsub(BAD_STUFF, "")
40
+ Parser::LogLine.new(date, options, sender: sendername, contents: contents, \
41
+ flags: flags, type: :ooc)
42
+ else
43
+ # Only put text and emotes in the log
44
+ nil
45
+ end
46
+ end
47
+ end
48
+
49
+ end
50
+
51
+ end
52
+ end
@@ -5,7 +5,7 @@ module Jekyll
5
5
 
6
6
  # Add this class to the parsing dictionary
7
7
  FORMAT_STR = 'weechat'
8
- RpLogs::RpLogGenerator.add self
8
+ RpLogGenerator.add self
9
9
 
10
10
  # Stuff
11
11
  class << self
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module RpLogs
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-rp_logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - anrodger
@@ -88,6 +88,9 @@ files:
88
88
  - jekyll-rp_logs.gemspec
89
89
  - lib/jekyll/rp_logs.rb
90
90
  - lib/jekyll/rp_logs/parse_irssi_xchat.rb
91
+ - lib/jekyll/rp_logs/parse_mirc.rb
92
+ - lib/jekyll/rp_logs/parse_skype_12hour.rb
93
+ - lib/jekyll/rp_logs/parse_skype_24hour.rb
91
94
  - lib/jekyll/rp_logs/parse_weechat.rb
92
95
  - lib/jekyll/rp_logs/rp_arcs.rb
93
96
  - lib/jekyll/rp_logs/rp_log_converter.rb