comment_extractor 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +132 -0
- data/bin/comment_parser_debug +45 -0
- data/lib/comment_extractor/code_object/comment.rb +19 -0
- data/lib/comment_extractor/code_object.rb +12 -0
- data/lib/comment_extractor/code_objects.rb +46 -0
- data/lib/comment_extractor/configuration.rb +50 -0
- data/lib/comment_extractor/encoding.rb +40 -0
- data/lib/comment_extractor/extractor/c.rb +8 -0
- data/lib/comment_extractor/extractor/cc.rb +8 -0
- data/lib/comment_extractor/extractor/class.rb +8 -0
- data/lib/comment_extractor/extractor/clojure.rb +11 -0
- data/lib/comment_extractor/extractor/coffee.rb +13 -0
- data/lib/comment_extractor/extractor/concerns/simple_extractor.rb +189 -0
- data/lib/comment_extractor/extractor/concerns/slash_extractor.rb +16 -0
- data/lib/comment_extractor/extractor/cpp.rb +8 -0
- data/lib/comment_extractor/extractor/cs.rb +8 -0
- data/lib/comment_extractor/extractor/css.rb +8 -0
- data/lib/comment_extractor/extractor/cxx.rb +8 -0
- data/lib/comment_extractor/extractor/d.rb +9 -0
- data/lib/comment_extractor/extractor/erlang.rb +12 -0
- data/lib/comment_extractor/extractor/fortran.rb +11 -0
- data/lib/comment_extractor/extractor/go.rb +8 -0
- data/lib/comment_extractor/extractor/h.rb +8 -0
- data/lib/comment_extractor/extractor/haml.rb +49 -0
- data/lib/comment_extractor/extractor/haskell.rb +12 -0
- data/lib/comment_extractor/extractor/hpp.rb +8 -0
- data/lib/comment_extractor/extractor/html.rb +13 -0
- data/lib/comment_extractor/extractor/java.rb +8 -0
- data/lib/comment_extractor/extractor/java_script.rb +12 -0
- data/lib/comment_extractor/extractor/lisp.rb +11 -0
- data/lib/comment_extractor/extractor/lua.rb +12 -0
- data/lib/comment_extractor/extractor/m.rb +9 -0
- data/lib/comment_extractor/extractor/markdown.rb +7 -0
- data/lib/comment_extractor/extractor/mm.rb +8 -0
- data/lib/comment_extractor/extractor/perl.rb +12 -0
- data/lib/comment_extractor/extractor/php.rb +8 -0
- data/lib/comment_extractor/extractor/python.rb +13 -0
- data/lib/comment_extractor/extractor/ruby.rb +40 -0
- data/lib/comment_extractor/extractor/sass.rb +8 -0
- data/lib/comment_extractor/extractor/scala.rb +8 -0
- data/lib/comment_extractor/extractor/scss.rb +8 -0
- data/lib/comment_extractor/extractor/shell.rb +11 -0
- data/lib/comment_extractor/extractor/sqf.rb +8 -0
- data/lib/comment_extractor/extractor/sql.rb +12 -0
- data/lib/comment_extractor/extractor/sqs.rb +7 -0
- data/lib/comment_extractor/extractor/tex.rb +12 -0
- data/lib/comment_extractor/extractor/text.rb +10 -0
- data/lib/comment_extractor/extractor/yaml.rb +12 -0
- data/lib/comment_extractor/extractor.rb +96 -0
- data/lib/comment_extractor/extractor_manager.rb +158 -0
- data/lib/comment_extractor/file.rb +42 -0
- data/lib/comment_extractor/parser.rb +33 -0
- data/lib/comment_extractor/smart_string_scanner.rb +11 -0
- data/lib/comment_extractor/version.rb +4 -0
- data/lib/comment_extractor.rb +18 -0
- data/spec/assets/binary_file +0 -0
- data/spec/assets/shebang_file +3 -0
- data/spec/assets/source_code/c.c +158 -0
- data/spec/assets/source_code/cc.cc +24 -0
- data/spec/assets/source_code/class +0 -0
- data/spec/assets/source_code/clojure.clj +41 -0
- data/spec/assets/source_code/coffee.coffee +27 -0
- data/spec/assets/source_code/cpp.cpp +130 -0
- data/spec/assets/source_code/cs.cs +53 -0
- data/spec/assets/source_code/css.css +37 -0
- data/spec/assets/source_code/cxx +0 -0
- data/spec/assets/source_code/d.d +110 -0
- data/spec/assets/source_code/erlang.es +34 -0
- data/spec/assets/source_code/fortran.f +41 -0
- data/spec/assets/source_code/golang.go +61 -0
- data/spec/assets/source_code/h +0 -0
- data/spec/assets/source_code/haml.haml +26 -0
- data/spec/assets/source_code/haskell.hs +36 -0
- data/spec/assets/source_code/hpp +0 -0
- data/spec/assets/source_code/html.html +139 -0
- data/spec/assets/source_code/java.java +39 -0
- data/spec/assets/source_code/java_script.js +164 -0
- data/spec/assets/source_code/lisp.el +18 -0
- data/spec/assets/source_code/lua.lua +34 -0
- data/spec/assets/source_code/m +0 -0
- data/spec/assets/source_code/mm +0 -0
- data/spec/assets/source_code/perl.pl +36 -0
- data/spec/assets/source_code/php.php +31 -0
- data/spec/assets/source_code/python.py +139 -0
- data/spec/assets/source_code/ruby.rb +36 -0
- data/spec/assets/source_code/sass.sass +77 -0
- data/spec/assets/source_code/scala.scala +46 -0
- data/spec/assets/source_code/scss.scss +93 -0
- data/spec/assets/source_code/shell.sh +5 -0
- data/spec/assets/source_code/sqf +0 -0
- data/spec/assets/source_code/sql.sql +11 -0
- data/spec/assets/source_code/sqs +0 -0
- data/spec/assets/source_code/tex.tex +20 -0
- data/spec/assets/source_code/text.txt +15 -0
- data/spec/assets/source_code/vim +17 -0
- data/spec/assets/source_code/yaml.yml +44 -0
- data/spec/assets/stripper/children/children +0 -0
- data/spec/assets/stripper/children/children.c +0 -0
- data/spec/assets/stripper/children/children.js +0 -0
- data/spec/assets/stripper/children/children.o +0 -0
- data/spec/assets/stripper/children/children.rb +1 -0
- data/spec/assets/stripper/test +0 -0
- data/spec/assets/stripper/test.c +0 -0
- data/spec/assets/stripper/test.js +0 -0
- data/spec/assets/stripper/test.o +0 -0
- data/spec/assets/stripper/test.rb +1 -0
- data/spec/comment_extractor/code_object/comment_spec.rb +15 -0
- data/spec/comment_extractor/code_object_spec.rb +18 -0
- data/spec/comment_extractor/code_objects_spec.rb +66 -0
- data/spec/comment_extractor/configuration_spec.rb +68 -0
- data/spec/comment_extractor/encoding_spec.rb +77 -0
- data/spec/comment_extractor/extractor/c_spec.rb +9 -0
- data/spec/comment_extractor/extractor/cc_spec.rb +9 -0
- data/spec/comment_extractor/extractor/class_spec.rb +9 -0
- data/spec/comment_extractor/extractor/clojure_spec.rb +9 -0
- data/spec/comment_extractor/extractor/coffee_spec.rb +9 -0
- data/spec/comment_extractor/extractor/cpp_spec.rb +9 -0
- data/spec/comment_extractor/extractor/cs_spec.rb +9 -0
- data/spec/comment_extractor/extractor/css_spec.rb +9 -0
- data/spec/comment_extractor/extractor/cxx_spec.rb +9 -0
- data/spec/comment_extractor/extractor/d_spec.rb +10 -0
- data/spec/comment_extractor/extractor/erlang_spec.rb +10 -0
- data/spec/comment_extractor/extractor/fortran_spec.rb +9 -0
- data/spec/comment_extractor/extractor/go_spec.rb +9 -0
- data/spec/comment_extractor/extractor/h_spec.rb +9 -0
- data/spec/comment_extractor/extractor/haml_spec.rb +9 -0
- data/spec/comment_extractor/extractor/haskell_spec.rb +9 -0
- data/spec/comment_extractor/extractor/hpp_spec.rb +9 -0
- data/spec/comment_extractor/extractor/html_spec.rb +9 -0
- data/spec/comment_extractor/extractor/java_script_spec.rb +10 -0
- data/spec/comment_extractor/extractor/java_spec.rb +9 -0
- data/spec/comment_extractor/extractor/lisp_spec.rb +9 -0
- data/spec/comment_extractor/extractor/lua_spec.rb +9 -0
- data/spec/comment_extractor/extractor/m_spec.rb +9 -0
- data/spec/comment_extractor/extractor/markdown_spec.rb +8 -0
- data/spec/comment_extractor/extractor/mm_spec.rb +9 -0
- data/spec/comment_extractor/extractor/perl_spec.rb +9 -0
- data/spec/comment_extractor/extractor/php_spec.rb +9 -0
- data/spec/comment_extractor/extractor/python_spec.rb +9 -0
- data/spec/comment_extractor/extractor/ruby_spec.rb +12 -0
- data/spec/comment_extractor/extractor/sass_spec.rb +9 -0
- data/spec/comment_extractor/extractor/scala_spec.rb +9 -0
- data/spec/comment_extractor/extractor/scss_spec.rb +9 -0
- data/spec/comment_extractor/extractor/shell_spec.rb +9 -0
- data/spec/comment_extractor/extractor/sqf_spec.rb +9 -0
- data/spec/comment_extractor/extractor/sql_spec.rb +9 -0
- data/spec/comment_extractor/extractor/sqs_spec.rb +9 -0
- data/spec/comment_extractor/extractor/tex_spec.rb +9 -0
- data/spec/comment_extractor/extractor/text_spec.rb +7 -0
- data/spec/comment_extractor/extractor/yaml_spec.rb +9 -0
- data/spec/comment_extractor/extractor_manager_spec.rb +233 -0
- data/spec/comment_extractor/extractor_spec.rb +102 -0
- data/spec/comment_extractor/file_spec.rb +100 -0
- data/spec/comment_extractor/parser_spec.rb +67 -0
- data/spec/comment_extractor/smart_string_scanner_spec.rb +24 -0
- data/spec/comment_extractor/version_spec.rb +8 -0
- data/spec/comment_extractor_spec.rb +15 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/support/rspec/comment_extractor/extractor_example_group.rb +115 -0
- data/spec/support/rspec/comment_extractor/matchers/extract_comment.rb +58 -0
- data/spec/support/rspec/comment_extractor/matchers.rb +7 -0
- data/spec/support/rspec/comment_extractor.rb +6 -0
- metadata +370 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
--[-1-]Attribution-Share Alike 3.0 License, copyright (c) 2010 Pieter Hintjens, modified @alpaca-tc
|
2
|
+
--[-2-] Demonstrate identities as used by the request-reply pattern. Run this
|
3
|
+
--[-3-] program by itself. Note that the utility functions s_ are provided by
|
4
|
+
--[-4-] zhelpers.h. It gets boring for everyone to keep repeating this code.
|
5
|
+
--[-5-]
|
6
|
+
--[-6-] Author: Robert G. Jakabosky <bobby@sharedrealm.com>
|
7
|
+
--[-7-]
|
8
|
+
require"zmq"
|
9
|
+
require"zhelpers"
|
10
|
+
|
11
|
+
local context = zmq.init(1)
|
12
|
+
|
13
|
+
local sink = context:socket(zmq.ROUTER)
|
14
|
+
sink:bind("inproc://example")
|
15
|
+
|
16
|
+
--[-16-] First allow 0MQ to set the identity
|
17
|
+
local anonymous = context:socket(zmq.REQ)
|
18
|
+
anonymous:connect("inproc://example")
|
19
|
+
anonymous:send("ROUTER uses a generated UUID")
|
20
|
+
s_dump(sink)
|
21
|
+
|
22
|
+
--[[[-22-]
|
23
|
+
[-23-]
|
24
|
+
]]
|
25
|
+
local identified = context:socket(zmq.REQ) --[-25-] Then set the identity ourselves
|
26
|
+
identified:setopt(zmq.IDENTITY, "PEER2")
|
27
|
+
identified:connect("inproc://example")
|
28
|
+
identified:send("ROUTER socket uses REQ's socket identity")
|
29
|
+
s_dump(sink)
|
30
|
+
|
31
|
+
sink:close()
|
32
|
+
anonymous:close()
|
33
|
+
identified:close()
|
34
|
+
context:term()
|
File without changes
|
File without changes
|
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
=pod[-2-]
|
3
|
+
[-3-]Attribution-Share Alike 3.0 License, copyright (c) 2010 Pieter Hintjens, modified @alpaca-tc
|
4
|
+
[-4-]Hello World server
|
5
|
+
[-5-]
|
6
|
+
[-6-]Connects REP socket to tcp://*:5560
|
7
|
+
[-7-]
|
8
|
+
[-8-]Expects "Hello" from client, replies with "World"
|
9
|
+
[-9-]
|
10
|
+
[-10-]Author: Daisuke Maki (lestrrat)
|
11
|
+
[-11-]Original version Author: Alexander D'Archangel (darksuji) <darksuji(at)gmail(dot)com>
|
12
|
+
[-12-]
|
13
|
+
=cut
|
14
|
+
|
15
|
+
use strict;
|
16
|
+
use warnings;
|
17
|
+
use 5.10.0;
|
18
|
+
|
19
|
+
use ZMQ::LibZMQ3;
|
20
|
+
use ZMQ::Constants qw(ZMQ_REP);
|
21
|
+
use zhelpers;
|
22
|
+
|
23
|
+
my $context = zmq_init();
|
24
|
+
|
25
|
+
#[-25-] Socket to talk to clients
|
26
|
+
my $responder = zmq_socket($context, ZMQ_REP);
|
27
|
+
zmq_connect($responder, 'tcp://localhost:5560');
|
28
|
+
|
29
|
+
while (1) {
|
30
|
+
my $string = s_recv($responder); #[-30-] Wait for next request from client
|
31
|
+
say "Received request: [$string]";
|
32
|
+
|
33
|
+
sleep (1);
|
34
|
+
|
35
|
+
s_send($responder, 'World');
|
36
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<?php
|
2
|
+
/*[-2-]Attribution-Share Alike 3.0 License, copyright (c) 2010 Pieter Hintjens, modified @alpaca-tc
|
3
|
+
[-3-]Lazy Pirate client
|
4
|
+
[-4-]Use zmq_poll to do a safe request-reply
|
5
|
+
[-5-]To run, start lpserver and then randomly kill/restart it
|
6
|
+
[-6-]
|
7
|
+
[-7-]@author Ian Barber <ian(dot)barber(at)gmail(dot)com>
|
8
|
+
[-8-][-end-]*/
|
9
|
+
|
10
|
+
define("REQUEST_TIMEOUT", 2500); //[-10-] msecs, (> 1000!)
|
11
|
+
define("REQUEST_RETRIES", 3); //[-11-] Before we abandon
|
12
|
+
|
13
|
+
function client_socket(ZMQContext $context)
|
14
|
+
{
|
15
|
+
echo "I: connecting to server...", PHP_EOL;
|
16
|
+
$client = new ZMQSocket($context,ZMQ::SOCKET_REQ);
|
17
|
+
$client->connect("tcp://localhost:5555");
|
18
|
+
|
19
|
+
//[-19-] Configure socket to not wait at close time
|
20
|
+
$client->setSockOpt(ZMQ::SOCKOPT_LINGER, 0);
|
21
|
+
/*[-21-] [-end-]*/
|
22
|
+
|
23
|
+
return $client;
|
24
|
+
}
|
25
|
+
|
26
|
+
$context = new ZMQContext();
|
27
|
+
$client = client_socket($context);
|
28
|
+
|
29
|
+
$sequence = 0;
|
30
|
+
$retries_left = REQUEST_RETRIES;
|
31
|
+
$read = $write = array();
|
@@ -0,0 +1,139 @@
|
|
1
|
+
"""[-1-]Attribution-Share Alike 3.0 License, copyright (c) 2010 Pieter Hintjens, modified @alpaca-tc
|
2
|
+
[-2-]=====================================================================
|
3
|
+
[-3-]kvmsg - key-value message class for example applications
|
4
|
+
[-4-]
|
5
|
+
[-5-]Author: Min RK <benjaminrk@gmail.com>
|
6
|
+
[-6-]
|
7
|
+
"""
|
8
|
+
|
9
|
+
import struct #[-9-] for packing integers
|
10
|
+
import sys
|
11
|
+
from uuid import uuid4
|
12
|
+
|
13
|
+
import zmq
|
14
|
+
import zmq.utils.jsonapi as json
|
15
|
+
|
16
|
+
class KVMsg(object):
|
17
|
+
"""[-17-]
|
18
|
+
[-18-]Message is formatted on wire as 5 frames:
|
19
|
+
"""
|
20
|
+
key = None
|
21
|
+
sequence = 0
|
22
|
+
uuid=None
|
23
|
+
properties = None
|
24
|
+
body = None
|
25
|
+
|
26
|
+
def __init__(self, sequence, uuid=None, key=None, properties=None, body=None):
|
27
|
+
assert isinstance(sequence, int)
|
28
|
+
self.sequence = sequence
|
29
|
+
if uuid is None:
|
30
|
+
uuid = uuid4().bytes
|
31
|
+
self.uuid = uuid
|
32
|
+
self.key = key
|
33
|
+
self.properties = {} if properties is None else properties
|
34
|
+
self.body = body
|
35
|
+
|
36
|
+
def __getitem__(self, k):
|
37
|
+
return self.properties[k]
|
38
|
+
|
39
|
+
def __setitem__(self, k, v):
|
40
|
+
self.properties[k] = v
|
41
|
+
|
42
|
+
def get(self, k, default=None):
|
43
|
+
return self.properties.get(k, default)
|
44
|
+
|
45
|
+
def store(self, dikt):
|
46
|
+
"""[-46-] Store me in a dict if I have anything to store
|
47
|
+
[-47-] else delete me from the dict.[-end-]"""
|
48
|
+
if self.key is not None and self.body is not None:
|
49
|
+
dikt[self.key] = self
|
50
|
+
elif self.key in dikt:
|
51
|
+
del dikt[self.key]
|
52
|
+
|
53
|
+
def send(self, socket):
|
54
|
+
|
55
|
+
key = '' if self.key is None else self.key
|
56
|
+
seq_s = struct.pack('!q', self.sequence)
|
57
|
+
body = '' if self.body is None else self.body
|
58
|
+
prop_s = json.dumps(self.properties)
|
59
|
+
socket.send_multipart([ key, seq_s, self.uuid, prop_s, body ])
|
60
|
+
|
61
|
+
@classmethod
|
62
|
+
def recv(cls, socket):
|
63
|
+
|
64
|
+
return cls.from_msg(socket.recv_multipart())
|
65
|
+
|
66
|
+
@classmethod
|
67
|
+
def from_msg(cls, msg):
|
68
|
+
|
69
|
+
key, seq_s, uuid, prop_s, body = msg
|
70
|
+
key = key if key else None
|
71
|
+
seq = struct.unpack('!q',seq_s)[0]
|
72
|
+
body = body if body else None
|
73
|
+
prop = json.loads(prop_s)
|
74
|
+
return cls(seq, uuid=uuid, key=key, properties=prop, body=body)
|
75
|
+
|
76
|
+
def dump(self):
|
77
|
+
if self.body is None:
|
78
|
+
size = 0
|
79
|
+
data='NULL'
|
80
|
+
else:
|
81
|
+
size = len(self.body)
|
82
|
+
data=repr(self.body)
|
83
|
+
print >> sys.stderr, "[seq:{seq}][key:{key}][size:{size}] {props} {data}".format(
|
84
|
+
seq=self.sequence,
|
85
|
+
key=self.key,
|
86
|
+
size=size,
|
87
|
+
props=json.dumps(self.properties),
|
88
|
+
data=data,
|
89
|
+
)
|
90
|
+
|
91
|
+
#[-91-] Runs self test of class
|
92
|
+
|
93
|
+
def test_kvmsg (verbose):
|
94
|
+
print " * kvmsg: ",
|
95
|
+
|
96
|
+
ctx = zmq.Context()
|
97
|
+
output = ctx.socket(zmq.DEALER)
|
98
|
+
output.bind("ipc://kvmsg_selftest.ipc")
|
99
|
+
input = ctx.socket(zmq.DEALER)
|
100
|
+
input.connect("ipc://kvmsg_selftest.ipc")
|
101
|
+
|
102
|
+
kvmap = {}
|
103
|
+
kvmsg = KVMsg(1)
|
104
|
+
kvmsg.key = "key"
|
105
|
+
kvmsg.body = "body"
|
106
|
+
if verbose:
|
107
|
+
kvmsg.dump()
|
108
|
+
kvmsg.send(output)
|
109
|
+
kvmsg.store(kvmap)
|
110
|
+
|
111
|
+
kvmsg2 = KVMsg.recv(input)
|
112
|
+
if verbose:
|
113
|
+
kvmsg2.dump()
|
114
|
+
assert kvmsg2.key == "key"
|
115
|
+
kvmsg2.store(kvmap)
|
116
|
+
|
117
|
+
assert len(kvmap) == 1
|
118
|
+
|
119
|
+
kvmsg = KVMsg(2, key="key", body="body")
|
120
|
+
kvmsg["prop1"] = "value1"
|
121
|
+
kvmsg["prop2"] = "value2"
|
122
|
+
kvmsg["prop3"] = "value3"
|
123
|
+
assert kvmsg["prop1"] == "value1"
|
124
|
+
if verbose:
|
125
|
+
kvmsg.dump()
|
126
|
+
kvmsg.send(output)
|
127
|
+
kvmsg2 = KVMsg.recv(input)
|
128
|
+
if verbose:
|
129
|
+
kvmsg2.dump()
|
130
|
+
#[-130-] ensure properties were preserved
|
131
|
+
assert kvmsg2.key == kvmsg.key
|
132
|
+
assert kvmsg2.body == kvmsg.body
|
133
|
+
assert kvmsg2.properties == kvmsg.properties
|
134
|
+
assert kvmsg2["prop2"] == kvmsg["prop2"]
|
135
|
+
|
136
|
+
print "OK"
|
137
|
+
|
138
|
+
if __name__ == '__main__':
|
139
|
+
test_kvmsg('-v' in sys.argv)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
#[-3-]encoding: utf-8
|
4
|
+
#[-4-]Source code from [https://github.com/thoughtbot/paperclip]
|
5
|
+
#[-5-]Copyright (c) 2008-2014 Jon Yurek and thoughtbot, inc.
|
6
|
+
require 'uri'
|
7
|
+
require 'paperclip/url_generator'
|
8
|
+
require 'active_support/deprecation'
|
9
|
+
|
10
|
+
module Paperclip
|
11
|
+
#[-11-]The Attachment class manages the files for a given attachment. It saves
|
12
|
+
#[-12-]when the model saves, deletes when the model is destroyed, and processes
|
13
|
+
#[-13-]the file upon assignment.
|
14
|
+
class Attachment
|
15
|
+
#[-15-]What gets called when you call instance.attachment = File. It clears
|
16
|
+
#[-16-]errors, assigns attributes, and processes the file. It
|
17
|
+
#[-17-]also queues up the previous file for deletion, to be flushed away on
|
18
|
+
#[-18-]#save of its host. In addition to form uploads, you can also assign
|
19
|
+
=begin
|
20
|
+
[-20-]another Paperclip attachment:
|
21
|
+
[-21-] new_user.avatar = old_user.avatar
|
22
|
+
[-22-] new_user.avatar = old_user.avatar
|
23
|
+
=end
|
24
|
+
def assign uploaded_file
|
25
|
+
@dirty = true
|
26
|
+
|
27
|
+
post_process(*only_process) if post_processing
|
28
|
+
|
29
|
+
#[-29-]Reset the file size if the original file was reprocessed.
|
30
|
+
instance_write(:file_size, @queued_for_write[:original].size)
|
31
|
+
instance_write(:fingerprint, @queued_for_write[:original].fingerprint) if instance_respond_to?(:fingerprint)
|
32
|
+
updater = :"#{name}_file_name_will_change!"
|
33
|
+
instance.send updater if instance.respond_to? updater
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
@import 'sidebar'
|
2
|
+
@import 'index_contents'
|
3
|
+
@import 'page_contents'
|
4
|
+
@import 'post_contents'
|
5
|
+
|
6
|
+
//[-6-] single line
|
7
|
+
/*[-7-] multi line[-end-]*/
|
8
|
+
//[-8-]-------------------- /* */
|
9
|
+
/*[-9-] multi_line
|
10
|
+
[-10-] multi_line
|
11
|
+
[-11-] multi_line[-end-]*/
|
12
|
+
=blockquote
|
13
|
+
+transition(all, 0.3s)
|
14
|
+
color: #606060
|
15
|
+
background: #f9f9f9
|
16
|
+
position: relative
|
17
|
+
overflow: hidden
|
18
|
+
display: block
|
19
|
+
padding: 15px 60px
|
20
|
+
margin-top: $space_width
|
21
|
+
margin-bottom: $space_width
|
22
|
+
p
|
23
|
+
margin: 0px
|
24
|
+
&:hover
|
25
|
+
color: #454545
|
26
|
+
&:before
|
27
|
+
color: #b8cec7
|
28
|
+
&:before
|
29
|
+
left: -3px
|
30
|
+
&:after
|
31
|
+
right: -2px
|
32
|
+
&:before, &:after
|
33
|
+
display: block
|
34
|
+
content: "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
|
35
|
+
font-size: 24px
|
36
|
+
overflow: hidden
|
37
|
+
position: absolute
|
38
|
+
top: 0px
|
39
|
+
bottom: 0px
|
40
|
+
line-height: 0.4em
|
41
|
+
word-break: break-all
|
42
|
+
color: #d0dfda
|
43
|
+
width: 7px !important
|
44
|
+
|
45
|
+
#main_contents
|
46
|
+
#breadcrumb
|
47
|
+
display: block
|
48
|
+
margin-top: $space_width / 2
|
49
|
+
margin-bottom: $space_width / 2
|
50
|
+
a
|
51
|
+
text-decoration: none
|
52
|
+
color: $cl_normal
|
53
|
+
.post_row
|
54
|
+
+box-shadow(0px 4px 4px #eee)
|
55
|
+
+readable_font
|
56
|
+
background-color: white
|
57
|
+
border: 1px solid #eee
|
58
|
+
color: #403f3f
|
59
|
+
font-size: 14px
|
60
|
+
line-height: 20px
|
61
|
+
text-shadow: 0 1px 0 rgba(255,255,255,1)
|
62
|
+
position: relative
|
63
|
+
padding-top: $space_width
|
64
|
+
padding-bottom: $space_width
|
65
|
+
margin-bottom: $space_width
|
66
|
+
|
67
|
+
header.field-items, footer
|
68
|
+
h1
|
69
|
+
padding-left: $space_width
|
70
|
+
padding-right: $space_width
|
71
|
+
&, & > a
|
72
|
+
font-size: 30px
|
73
|
+
letter-spacing: -1px
|
74
|
+
line-height: 1.3
|
75
|
+
+readable_font
|
76
|
+
+link-colors($cl_normal, $cl_normal, $cl_normal, $cl_normal)
|
77
|
+
text-decoration: none
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/*[-1-]Attribution-Share Alike 3.0 License, copyright (c) 2010 Pieter Hintjens, modified @alpaca-tc
|
2
|
+
[-2-]Asynchronous client-to-server (DEALER to BROKER)
|
3
|
+
[-3-]
|
4
|
+
[-4-]While this example runs in a single process, that is just to make
|
5
|
+
[-5-]it easier to start and stop the example. Each task has its own
|
6
|
+
[-6-]context and conceptually acts as a separate process.
|
7
|
+
[-7-]
|
8
|
+
[-8-]@Author: Giovanni Ruggiero
|
9
|
+
[-9-]@Email: giovanni.ruggiero@gmail.com
|
10
|
+
*/
|
11
|
+
|
12
|
+
import org.zeromq.ZMQ
|
13
|
+
import ZHelpers._
|
14
|
+
|
15
|
+
object asyncsrv {
|
16
|
+
//[-16-] ---------------------------------------------------------------------
|
17
|
+
//[-17-] This is our client task
|
18
|
+
//[-18-] It connects to the server, and then sends a request once per second
|
19
|
+
//[-19-] It collects responses as they arrive, and it prints them out. We will
|
20
|
+
//[-20-] run several client tasks in parallel, each with a different random ID.
|
21
|
+
class ClientTask() extends Runnable {
|
22
|
+
def run() {
|
23
|
+
val ctx = ZMQ.context(1)
|
24
|
+
val client = ctx.socket(ZMQ.DEALER)
|
25
|
+
setID(client);
|
26
|
+
val identity = new String(client getIdentity)
|
27
|
+
client.connect("tcp://localhost:5570")
|
28
|
+
val poller = ctx.poller(1)
|
29
|
+
|
30
|
+
poller.register(client,ZMQ.Poller.POLLIN)
|
31
|
+
var requestNbr = 0
|
32
|
+
while (true) { //[-32-] Tick once per second, pulling in arriving messages
|
33
|
+
for (centitick <- 1 to 100) {
|
34
|
+
poller.poll(10000)
|
35
|
+
if(poller.pollin(0)) {
|
36
|
+
val msg = new ZMsg(client)
|
37
|
+
printf("%s : %s\n", identity, msg.bodyToString)
|
38
|
+
}
|
39
|
+
}
|
40
|
+
requestNbr += 1
|
41
|
+
val msg = new ZMsg("request: %d" format requestNbr)
|
42
|
+
client.sendMsg(msg)
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
@import "sidebar"
|
2
|
+
@import "index_contents"
|
3
|
+
@import "page_contents"
|
4
|
+
@import "post_contents"
|
5
|
+
|
6
|
+
//[-6-] single line
|
7
|
+
/*[-7-] multi line[-end-]*/
|
8
|
+
//[-8-]-------------------- /*
|
9
|
+
/*[-9-] multi_line [-end-]*/
|
10
|
+
//[-10-] multi_line {}
|
11
|
+
|
12
|
+
//[-12-] multi_line*/ {}[-end-]
|
13
|
+
|
14
|
+
@mixin blockquote {
|
15
|
+
@include transition(all, 0.3s)
|
16
|
+
color: #606060
|
17
|
+
background: #f9f9f9
|
18
|
+
position: relative
|
19
|
+
overflow: hidden
|
20
|
+
display: block
|
21
|
+
padding: 15px 60px
|
22
|
+
margin-top: $space_width
|
23
|
+
margin-bottom: $space_width
|
24
|
+
p {
|
25
|
+
margin: 0px
|
26
|
+
}
|
27
|
+
&:hover {
|
28
|
+
color: #454545
|
29
|
+
&:before {
|
30
|
+
color: #b8cec7
|
31
|
+
}
|
32
|
+
}
|
33
|
+
&:before {
|
34
|
+
left: -3px
|
35
|
+
}
|
36
|
+
&:after {
|
37
|
+
right: -2px
|
38
|
+
}
|
39
|
+
&:before, &:after {
|
40
|
+
display: block
|
41
|
+
content: "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
|
42
|
+
font-size: 24px
|
43
|
+
overflow: hidden
|
44
|
+
position: absolute
|
45
|
+
top: 0px
|
46
|
+
bottom: 0px
|
47
|
+
line-height: 0.4em
|
48
|
+
word-break: break-all
|
49
|
+
color: #d0dfda
|
50
|
+
width: 7px !important
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
#main_contents {
|
55
|
+
#breadcrumb {
|
56
|
+
display: block
|
57
|
+
margin-top: $space_width / 2
|
58
|
+
margin-bottom: $space_width / 2
|
59
|
+
a {
|
60
|
+
text-decoration: none
|
61
|
+
color: $cl_normal
|
62
|
+
}
|
63
|
+
}
|
64
|
+
.post_row {
|
65
|
+
@include box-shadow(0px 4px 4px #eeeeee)
|
66
|
+
@include readable_font
|
67
|
+
background-color: white
|
68
|
+
border: 1px solid #eeeeee
|
69
|
+
color: #403f3f
|
70
|
+
font-size: 14px
|
71
|
+
line-height: 20px
|
72
|
+
text-shadow: 0 1px 0 rgba(255, 255, 255, 1)
|
73
|
+
position: relative
|
74
|
+
padding-top: $space_width
|
75
|
+
padding-bottom: $space_width
|
76
|
+
margin-bottom: $space_width
|
77
|
+
header.field-items, footer {
|
78
|
+
h1 {
|
79
|
+
padding-left: $space_width
|
80
|
+
padding-right: $space_width
|
81
|
+
&, & > a {
|
82
|
+
font-size: 30px
|
83
|
+
letter-spacing: -1px
|
84
|
+
line-height: 1.3
|
85
|
+
@include readable_font
|
86
|
+
@include link-colors($cl_normal, $cl_normal, $cl_normal, $cl_normal)
|
87
|
+
text-decoration: none
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
/*[-91-] multi_line [-end-]*/
|
92
|
+
}
|
93
|
+
}
|
File without changes
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/*[-1-] this is comment
|
2
|
+
[-2-]comemnt out[-end-]*/
|
3
|
+
select SessionSID
|
4
|
+
, TargetID
|
5
|
+
--[-5-], TargetName
|
6
|
+
, FEDSurveyName
|
7
|
+
, SupplierID
|
8
|
+
, ClientLK_ResponseStatusID
|
9
|
+
from BI_Sessions (nolock)
|
10
|
+
WHERE EntryDate BETWEEN '05-15-2012' AND '05-16-2012'
|
11
|
+
AND SupplierID = 336
|
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
\documentclass[12pt]{article}
|
2
|
+
%[-2-] options include 12pt or 11pt or 10pt
|
3
|
+
%[-3-] classes include article, report, book, letter, thesis
|
4
|
+
|
5
|
+
\title{This is the title}
|
6
|
+
\author{Author One \\ Author Two}
|
7
|
+
\date{29 February 2004}
|
8
|
+
|
9
|
+
\begin{document}
|
10
|
+
\maketitle
|
11
|
+
|
12
|
+
This is the content of this document.%[-12-]
|
13
|
+
|
14
|
+
This is the 2nd paragraph.
|
15
|
+
\%Here is an inline formula:
|
16
|
+
$ V = \frac{4 \pi r^3}{3} $.
|
17
|
+
And appearing immediately below
|
18
|
+
is a displayed formula:
|
19
|
+
$$ V = \frac{4 \pi r^3}{3} $$
|
20
|
+
\end{document}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#[-1-] strip\_comment
|
2
|
+
|
3
|
+
#[-3-] Description
|
4
|
+
|
5
|
+
comment\_extractor extracts the comment out from a source code.
|
6
|
+
|
7
|
+
#[-7-] Installation
|
8
|
+
|
9
|
+
CommentExtractor has been tested with ruby 2.1.
|
10
|
+
|
11
|
+
```sh
|
12
|
+
git clone https://github.com/alpaca-tc/comment_extractor
|
13
|
+
cd comment_extractor
|
14
|
+
rake install
|
15
|
+
```
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"[-1-] ----------------------------------------
|
2
|
+
"[-2-] basic settings "{{{
|
3
|
+
set nocompatible
|
4
|
+
let &directory = g:my.dir.swap_dir
|
5
|
+
set viminfo='1000,<800,s300,\"1000,f1,:1000,/1000
|
6
|
+
execute 'set viminfo+=n' . g:my.dir.viminfo . '/.viminfo'
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
set visualbell t_vb=
|
11
|
+
set helplang=en
|
12
|
+
set langmenu=en_us.UTF-8
|
13
|
+
language en_US.UTF-8
|
14
|
+
"[-14-]
|
15
|
+
\[-15-]
|
16
|
+
"[-16-] ----------------------------------------
|
17
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
URL: ""
|
3
|
+
HTTPS_URL: ""
|
4
|
+
|
5
|
+
ADMIN_ENABLED: true
|
6
|
+
|
7
|
+
ANALYTICS_ENABLED: false
|
8
|
+
|
9
|
+
AWS_ACCESS_KEY_ID:
|
10
|
+
AWS_SECRET_ACCESS_KEY:
|
11
|
+
AWS_S3_BUCKETS:
|
12
|
+
AWS_S3_OBJECT_CACHE_CONTROL_MAX_AGE: 7776000
|
13
|
+
|
14
|
+
YAHOOJ_WALLET_API_HOST:
|
15
|
+
YAHOOJ_APPID:
|
16
|
+
YAHOOJ_PRIVATE_KEY:
|
17
|
+
YAHOOJ_WGW_KEY:
|
18
|
+
YAHOOJ_PID_PREMIUM_PROFILE_MONTHLY:
|
19
|
+
YAHOOJ_PROPERTY_ID:
|
20
|
+
|
21
|
+
#[-21-] https://dev.twitter.com/apps
|
22
|
+
TWITTER_CONSUMER_KEY: XXXXXXXXXXXXXXXXXXXXXX
|
23
|
+
TWITTER_CONSUMER_SECRET: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
24
|
+
|
25
|
+
#[-25-] https://developers.facebook.com/apps
|
26
|
+
FACEBOOK_APP_KEY: XXXXXXXXXXXXXXX
|
27
|
+
FACEBOOK_APP_SECRET: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
28
|
+
|
29
|
+
#[-29-] https://code.google.com/apis/console/
|
30
|
+
GOOGLE_CLIENT_ID: XXXXXXXXXXXXX.XXXX.googleusercontent.com
|
31
|
+
GOOGLE_CLIENT_SECRET: XXXXXXXXXXXXXXXXXXXXXXXX
|
32
|
+
|
33
|
+
#[-33-] https://code.google.com/apis/console/
|
34
|
+
GPLUS_CLIENT_ID: XXXXXXXXXXXXX.XXXX.googleusercontent.com
|
35
|
+
GPLUS_CLIENT_SECRET: #[-35-]XXXXXXXXXXXXXXXXXXXXXXXX
|
36
|
+
|
37
|
+
development:
|
38
|
+
<<: *defaults
|
39
|
+
|
40
|
+
test:
|
41
|
+
<<: *defaults
|
42
|
+
|
43
|
+
production:
|
44
|
+
<<: *defaults
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
# Hello World
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
# Hello World
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'comment_extractor/code_object/comment'
|
3
|
+
|
4
|
+
module CommentExtractor
|
5
|
+
describe CodeObject::Comment do
|
6
|
+
describe '.new' do
|
7
|
+
subject { described_class.new(line: line) }
|
8
|
+
let(:line) { 21 }
|
9
|
+
|
10
|
+
it "returns a instance of #{described_class}" do
|
11
|
+
expect(subject.line).to eql(line)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'comment_extractor/code_object'
|
3
|
+
|
4
|
+
module CommentExtractor
|
5
|
+
describe CodeObject do
|
6
|
+
describe 'ClassMethods' do
|
7
|
+
describe '.new' do
|
8
|
+
subject { described_class.new(value: value, other: :other) }
|
9
|
+
let(:value) { 'value' }
|
10
|
+
|
11
|
+
it "returns a instance of #{described_class}" do
|
12
|
+
expect(subject.value).to eql value
|
13
|
+
expect(subject.metadata).to eql({ other: :other })
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|