neolytics 0.1.0 → 0.2.0

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: b9f88458d8ba044e986867ec1e740f292dce0961
4
- data.tar.gz: 22b7537a706c4f377102f7e205d9a834e09bde12
3
+ metadata.gz: 662b2a85036ea4c9aa8be9d1babd5c0730df6048
4
+ data.tar.gz: c9a8576bdb9226b227b534321dedb93b236a72c1
5
5
  SHA512:
6
- metadata.gz: 96424597969051fa96d53b6e0e26796b4519542f2c2bce900c9b28cfd14816f0af3c0f8034b78d9517e6ebee7806cb53464ff592dc83444fded90b6a65993160
7
- data.tar.gz: 350a7ff4d6edbf45794aeae147f2ab8ee7229ec4a4aa59bf6c978b32eda3c14a1d4e6dabc84a573d1ca1597d6c19d5c55445135ec3d2bdcc0330dfad5267507c
6
+ metadata.gz: b431176ee6820f19bfad64a21e5f6c6cdb6a9ef7bac7e7ca6de324fbb4b0acea4fb5349b42dcd15e1fcf00aedc86d23a8d0931945f869d6aae0f5237f556e924
7
+ data.tar.gz: dd47cdaf7397b06af5004d8864be0ba98925a9b08df6583f37fcd904c5ad0bce964a6987d188edfb847e54b5a75d49949ba4babd8d66c286e74ee38ccc5bfa99
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Neolytics
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/neolytics`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Neolytics is a gem which allows you to analyze a section of your code using Neo4j. The data model used is described below and a number of example queries are given (you can [suggest an idea](https://github.com/neo4j-examples/ruby_code_analytics/labels/idea%20for%20query) for a new query).
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ There is also a [ruby_code_analytics](https://github.com/neo4j-examples/ruby_code_analytics) Rails application which can take data generated by neolytics and allow you to browse it with a nice UI.
6
6
 
7
7
  ## Installation
8
8
 
@@ -22,7 +22,229 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ All you need to do to use Neolytics is
26
+
27
+ neo4j_session = Neo4j::Session.open(:server_db, 'http://neo4j:pass@localhost:7474')
28
+ # or
29
+ neo4j_session = Neo4j::Session.current
30
+
31
+ Neolytics.record_execution(neo4j_session) do
32
+ # Code that you want to analyze here
33
+ end
34
+
35
+ During the code execution
36
+
37
+ ## Model:
38
+
39
+ Neolytics generates the following structures:
40
+
41
+ ### Abstract Syntax Trees
42
+
43
+ ![Abstract Syntax Tree](examples/model/ast.png)
44
+
45
+ ### TracePoint execution tracking
46
+
47
+ ![Abstract Syntax Tree](examples/model/trace_point_flow.png)
48
+
49
+ ### Objects (including recursively browsed class and modules)
50
+
51
+ ![Abstract Syntax Tree](examples/model/object_relationships.png)
52
+
53
+ ### Links between these domains
54
+
55
+ TracePoints are linked to AST nodes:
56
+
57
+ ![Abstract Syntax Tree](examples/model/trace_point_ast_nodes.png)
58
+
59
+ TracePoints are linked to objects (arguments, return values, variable values, context objects):
60
+
61
+ ![Abstract Syntax Tree](examples/model/trace_point_objects.png)
62
+
63
+ ## Example queries:
64
+
65
+ ### Queries using the abstract syntax trees:
66
+
67
+ #### Get all assignments
68
+
69
+ ```cypher
70
+ MATCH (a:ASTNode)
71
+ WHERE a.type IN ['lvasgn', 'ivasgn', 'casgn', 'op_asgn']
72
+ RETURN a.type, a.name, a.operator, a.expression
73
+ ORDER BY a.type, a.name
74
+ ```
75
+
76
+ [Example Output](examples/output/assignments.csv)
77
+
78
+ #### All defined methods:
79
+
80
+ ```cypher
81
+ MATCH (def:ASTNode {type: 'def'})
82
+ WITH def
83
+ ORDER BY def.file_path, def.first_line
84
+ LIMIT 50
85
+ MATCH shortestPath((def)-[:HAS_PARENT*]->(class:ASTNode {type: 'class'}))
86
+ RETURN def.file_path +':'+ def.first_line AS line, class.name AS class, def.name AS method
87
+ ```
88
+
89
+ [Example Output](examples/output/ast.csv)
90
+
91
+ #### Assignment-Branch-Condition (ABC) Metric
92
+
93
+ ```cypher
94
+ MATCH (def:ASTNode {type: 'def'})
95
+
96
+ OPTIONAL MATCH (def)<-[:HAS_PARENT*]-(assignment:ASTNode)
97
+ WHERE assignment.type IN ['lvasgn', 'ivasgn', 'casgn', 'op_asgn']
98
+ WITH def, count(assignment) AS a
99
+
100
+ OPTIONAL MATCH (def)<-[:HAS_PARENT*]-(branch:ASTNode)
101
+ WHERE branch.type = 'send'
102
+ WITH def, a, count(branch) AS b
103
+
104
+ OPTIONAL MATCH (def)<-[:HAS_PARENT*]-(condition:ASTNode)
105
+ WHERE condition.type IN ['if', 'while', 'until', 'for', 'rescue', 'when', 'and', 'or']
106
+ WITH def, a, b, count(condition) AS c
107
+
108
+ RETURN def.name, def.file_path, def.first_line, a, b, c, sqrt((a*a) + (b*b) + (c*c)) AS abc
109
+ ORDER BY abc DESC
110
+ ```
111
+
112
+ [Example Output](examples/output/abc.csv)
113
+
114
+ #### Cyclomatic Complexity
115
+
116
+ ```cypher
117
+ MATCH (def:ASTNode {type: 'def'})
118
+ OPTIONAL MATCH (def)<-[:HAS_PARENT*]-(condition:ASTNode)
119
+ WHERE condition.type IN ['begin', 'if', 'while', 'until', 'for', 'rescue', 'when', 'and', 'or']
120
+ RETURN def.name, def.file_path, def.first_line, count(condition)
121
+ ORDER BY count(condition) DESC
122
+ LIMIT 50
123
+ ```
124
+
125
+ [Example Output](examples/output/cyclomatic_complexity.csv)
126
+
127
+
128
+ #### All args / vars / statics / etc... in a class
129
+
130
+ ```cypher
131
+ MATCH (:ASTNode {name: 'Numeric', type: 'class'})<-[:HAS_PARENT*]-(n:ASTNode)
132
+ WHERE n.type IN ['def', 'arg', 'optarg', 'restarg', 'lvar', 'const', 'sym']
133
+ RETURN n.type, n.expression, n.name
134
+ ORDER BY n.type, n.expression
135
+ ```
136
+
137
+ [Example Output](examples/output/all_args_vars_statics.csv)
138
+
139
+ ### TracePoint queries
140
+
141
+ #### Time spent by method
142
+
143
+ ```cypher
144
+ MATCH (tp:TracePoint)
145
+ WITH tp.path AS path, tp.lineno AS line, tp.defined_class AS class, tp.method_id AS method_id, sum(tp.execution_time) AS sum, count(tp) AS count
146
+ ORDER BY sum(tp.execution_time) DESC
147
+ RETURN path +':'+ line AS line, class +'#'+ method_id AS method, sum, count, sum / count AS average
148
+ LIMIT 50
149
+ ```
150
+
151
+ [Example Output](examples/output/time_spent_by_method.csv)
152
+
153
+ #### Common ancestor
154
+
155
+ ```cypher
156
+ MATCH
157
+ (tp1:TracePoint {defined_class: 'ActiveSupport::Autoload', method_id: 'autoload_at'}),
158
+ (tp2:TracePoint {defined_class: 'ActiveSupport::Inflector', method_id: 'underscore'})
159
+ WITH tp1, tp2 LIMIT 1
160
+ MATCH
161
+ path1=(tp1)-[:HAS_PARENT*0..]->(common_ancestor),
162
+ path2=(common_ancestor)<-[:HAS_PARENT*0..]-(tp2:TracePoint)
163
+ RETURN tp1, tp2, common_ancestor, length(path1), length(path2)
164
+ ```
165
+
166
+ [Example Output](examples/output/common_ancestor.csv)
167
+
168
+ #### See all arguments and return values for methods
169
+
170
+ ```cypher
171
+ MATCH (start_tp:TracePoint)
172
+ WHERE start_tp.event = 'call'
173
+ OPTIONAL MATCH (start_tp)-[argument_rel:RECEIVED_ARGUMENT]->(arg:Object)-[:IS_A]->(class:Object)
174
+ WITH
175
+ start_tp,
176
+ collect(argument_rel.argument_name +': '+ arg.ruby_inspect +' ('+ class.ruby_inspect +')') AS arguments
177
+
178
+ OPTIONAL MATCH (start_tp)<-[:STARTED_AT]-(return_tp:TracePoint)-[:RETURNED]->(o:Object)-[:IS_A]-(class:Object)
179
+ RETURN
180
+ start_tp.path +':'+ start_tp.lineno AS line,
181
+ start_tp.defined_class +'#'+ start_tp.method_id AS method,
182
+ arguments,
183
+ o.ruby_inspect +' ('+ class.ruby_inspect +')' AS return_object
184
+ ORDER BY start_tp.execution_index
185
+ LIMIT 30
186
+ ```
187
+
188
+ [Example Output](examples/output/arguments_and_return_values.csv)
189
+
190
+ #### Show all returns values from a particular superclass (i.e. Asking for `Numeric` gives `Fixnum`, `Rational`, `BigDecimal`, etc... types)
191
+
192
+ ```cypher
193
+ MATCH (tp:TracePoint)-[:RETURNED]->(o:Object)-[:IS_A]-(class:Object)-[:HAS_SUPERCLASS*]->(superclass:Object {ruby_inspect: 'Numeric'})
194
+ WHERE tp.event IN ['return', 'c_return']
195
+ RETURN tp.path +':'+ tp.lineno AS line, tp.defined_class +'#'+ tp.method_id AS method, o.ruby_inspect +' ('+ class.ruby_inspect +')' AS return_value
196
+ ORDER BY tp.execution_index
197
+ ```
198
+
199
+ [Example Output](examples/output/numeric_return_values.csv)
200
+
201
+ ### Object space queries:
202
+
203
+ #### Show class hierarchy for `Numeric` class:
204
+
205
+ ```cypher
206
+ MATCH (class:Object)-[:HAS_SUPERCLASS*]->(superclass:Object {ruby_inspect: 'Numeric'})
207
+ RETURN *
208
+ ```
209
+
210
+ **Example Output:**
211
+
212
+ ![Example Output](examples/output/numeric_class_hierarchy.png)
213
+
214
+ ### Combination queries
215
+
216
+ #### Combining cyclomatic complexity and run-time metrics
217
+
218
+ ```cypher
219
+ MATCH (tp:TracePoint)
220
+ WITH sum(tp.execution_time) AS total_execution_time
221
+
222
+ MATCH (node:ASTNode {type: 'def'})
223
+ OPTIONAL MATCH (node)<-[:HAS_PARENT*]-(condition:ASTNode)
224
+ WHERE condition.type IN ['begin', 'if', 'while', 'until', 'for', 'rescue', 'when', 'and', 'or']
225
+ WITH node, count(condition) AS cyclomatic_complexity, total_execution_time
226
+
227
+ MATCH (node)<-[:HAS_AST_NODE]-(tp:TracePoint)<-[:STARTED_AT]-(return_tp:TracePoint)
228
+
229
+ WITH
230
+ cyclomatic_complexity,
231
+ total_execution_time,
232
+ tp.path + ':' + tp.lineno + ' (' + return_tp.defined_class + '#' + return_tp.method_id + ')' AS method,
233
+ count(tp) AS executions,
234
+ sum(return_tp.execution_time) AS total_method_execution_time
235
+
236
+ RETURN
237
+ method,
238
+ cyclomatic_complexity,
239
+ executions,
240
+ total_method_execution_time,
241
+ 100.0 * (total_method_execution_time / total_execution_time) AS percentage_of_total_time,
242
+ total_method_execution_time / executions AS average_execution_time
243
+
244
+ ORDER BY total_method_execution_time DESC
245
+ ```
246
+
247
+ [Example Output](examples/output/cyclomatic_complexity_and_runtime.csv)
26
248
 
27
249
  ## Development
28
250
 
Binary file
Binary file
@@ -0,0 +1,51 @@
1
+ def.name,def.file_path,def.first_line,a,b,c,abc
2
+ validate,/Users/brian/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/specification.rb,2453,10,146,36,150.70500987027606
3
+ parse,/Users/brian/.rvm/gems/ruby-2.2.3/gems/tzinfo-1.2.2/lib/tzinfo/zoneinfo_timezone_info.rb,95,44,134,28,143.79151574414954
4
+ pretty_print,/Users/brian/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/pp.rb,421,6,121,21,122.95527642195759
5
+ store_asset,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/loader.rb,197,2,111,13,111.77656283854859
6
+ perform_arguments,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/tree/visitors/perform.rb,14,21,102,28,107.83784122468327
7
+ to_json,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/source/map.rb,89,38,92,15,100.66280345788111
8
+ parse_import_arg,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/engine.rb,1017,27,90,9,94.39279633531363
9
+ visit_rule,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/tree/visitors/to_css.rb,280,24,88,24,94.31860898041276
10
+ resolve_parent_refs,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/selector/simple_sequence.rb,88,6,91,13,92.11948762341224
11
+ to_ruby,/Users/brian/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/specification.rb,2294,6,90,11,90.86803618434813
12
+ load_from_unloaded,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/loader.rb,101,22,87,9,90.18869108707588
13
+ merge_final_ops,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/selector/sequence.rb,342,14,79,36,87.9374777896205
14
+ do_extend,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/selector/simple_sequence.rb,157,12,83,13,84.86459803710851
15
+ visit_function,/Users/brian/.rvm/gems/ruby-2.2.3/gems/nokogiri-1.6.7/lib/nokogiri/css/xpath_visitor.rb,4,3,79,24,82.61961026293939
16
+ visit_directive,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/tree/visitors/to_css.rb,176,9,78,24,82.10359310042405
17
+ superselector?,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/selector/pseudo.rb,149,2,75,23,78.4729252672538
18
+ call,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/server.rb,22,18,72,23,77.69813382572325
19
+ _next_token,/Users/brian/.rvm/gems/ruby-2.2.3/gems/nokogiri-1.6.7/lib/nokogiri/css/tokenizer.rb,55,31,65,28,77.26577508832743
20
+ distance_of_time_in_words,/Users/brian/.rvm/gems/ruby-2.2.3/gems/actionview-4.2.5/lib/action_view/helpers/date_helper.rb,71,19,64,25,71.28814768248647
21
+ _superselector?,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/selector/sequence.rb,486,4,66,17,68.27151675479314
22
+ parse_tag,/Users/brian/.rvm/gems/ruby-2.2.3/gems/slim-3.0.6/lib/slim/parser.rb,316,19,60,21,66.34756966159348
23
+ parse_line,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/engine.rb,610,7,64,16,66.34003316248794
24
+ validate_dependencies,/Users/brian/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/specification.rb,2645,12,63,13,65.43699259593154
25
+ clean,/Users/brian/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb,149,24,59,5,63.89053137985315
26
+ initialize,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/script/value/color.rb,227,11,61,15,63.773035054010094
27
+ parse_property_or_rule,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/engine.rb,661,22,57,9,61.75759062657804
28
+ initialize,/Users/brian/.rvm/gems/ruby-2.2.3/gems/slim-3.0.6/lib/slim/parser.rb,46,22,57,7,61.497967446087195
29
+ construct_ruby_args,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/script/tree/funcall.rb,184,10,58,16,60.991802727907626
30
+ env_for,/Users/brian/.rvm/gems/ruby-2.2.3/gems/rack-test-0.6.3/lib/rack/test.rb,192,5,59,12,60.41522986797286
31
+ normalize_params,/Users/brian/.rvm/gems/ruby-2.2.3/gems/rack-1.6.4/lib/rack/utils.rb,134,3,58,14,59.74110812497538
32
+ parse_line_indicators,/Users/brian/.rvm/gems/ruby-2.2.3/gems/slim-3.0.6/lib/slim/parser.rb,190,9,57,15,59.62382074305537
33
+ try_declaration,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/scss/parser.rb,738,19,54,16,59.43904440685432
34
+ record_execution_trace,/Users/brian/github/neo4jrb/neolytics/lib/neolytics/recorder.rb,80,30,46,11,56.00892785976178
35
+ initialize_regexp,/Users/brian/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc2396_parser.rb,500,1,56,0,56.00892785976178
36
+ compile,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/manifest.rb,159,7,54,7,54.89990892524322
37
+ compute_processor_count,/Users/brian/.rvm/gems/ruby-2.2.3/gems/concurrent-ruby-1.0.0/lib/concurrent/utility/processor_counter.rb,75,2,53,13,54.607691765904185
38
+ subweave,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/selector/sequence.rb,258,13,49,18,53.79591062525106
39
+ tabulate,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/engine.rb,436,15,49,13,52.86775955154521
40
+ initialize_pattern,/Users/brian/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc2396_parser.rb,342,37,37,6,52.66877632905477
41
+ parse_comment,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/engine.rb,758,11,51,7,52.640288753007425
42
+ translate,/Users/brian/.rvm/gems/ruby-2.2.3/gems/actionview-4.2.5/lib/action_view/helpers/translation_helper.rb,38,11,49,14,52.1344415909483
43
+ handle_line,/Users/brian/.rvm/gems/ruby-2.2.3/gems/pry-0.10.3/lib/pry/pry_instance.rb,260,11,47,16,50.85272854036448
44
+ add_associations,/Users/brian/.rvm/gems/ruby-2.2.3/gems/activemodel-4.2.5/lib/active_model/serializers/xml.rb,123,8,49,8,50.28916384272063
45
+ buffer_open,/Users/brian/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/open-uri.rb,743,10,48,11,50.24937810560445
46
+ convert_input,/Users/brian/.rvm/gems/ruby-2.2.3/gems/erubis-2.7.0/lib/erubis/enhancer.rb,641,19,40,23,49.8998997994986
47
+ convert_input,/Users/brian/.rvm/gems/ruby-2.2.3/gems/erubis-2.7.0/lib/erubis/converter.rb,127,17,39,26,49.85980344927164
48
+ with_selector,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/selector/pseudo.rb,55,3,48,13,49.8196748283246
49
+ asset_from_cache,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/loader.rb,75,1,49,8,49.658836071740545
50
+ periods_for_local,/Users/brian/.rvm/gems/ruby-2.2.3/gems/tzinfo-1.2.2/lib/tzinfo/transition_data_timezone_info.rb,123,6,48,11,49.60846701924985
51
+ visit_rule,/Users/brian/.rvm/gems/ruby-2.2.3/gems/sass-3.4.20/lib/sass/tree/visitors/perform.rb,408,5,49,2,49.29503017546495
@@ -0,0 +1,117 @@
1
+ n.type,n.expression,n.name
2
+ const,ActiveSupport,ActiveSupport
3
+ const,ActiveSupport,ActiveSupport
4
+ const,ActiveSupport,ActiveSupport
5
+ const,ActiveSupport,ActiveSupport
6
+ const,ActiveSupport,ActiveSupport
7
+ const,ActiveSupport,ActiveSupport
8
+ const,ActiveSupport::Duration,Duration
9
+ const,ActiveSupport::Duration,Duration
10
+ const,ActiveSupport::Duration,Duration
11
+ const,ActiveSupport::Duration,Duration
12
+ const,ActiveSupport::Duration,Duration
13
+ const,ActiveSupport::Duration,Duration
14
+ const,EXABYTE,EXABYTE
15
+ const,GIGABYTE,GIGABYTE
16
+ const,GIGABYTE,GIGABYTE
17
+ const,KILOBYTE,KILOBYTE
18
+ const,KILOBYTE,KILOBYTE
19
+ const,MEGABYTE,MEGABYTE
20
+ const,MEGABYTE,MEGABYTE
21
+ const,Numeric,Numeric
22
+ const,Numeric,Numeric
23
+ const,Numeric,Numeric
24
+ const,Numeric,Numeric
25
+ const,Numeric,Numeric
26
+ const,Numeric,Numeric
27
+ const,PETABYTE,PETABYTE
28
+ const,PETABYTE,PETABYTE
29
+ const,TERABYTE,TERABYTE
30
+ const,TERABYTE,TERABYTE
31
+ def,def as_json(options = nil) #:nodoc:
32
+ self
33
+ end,as_json
34
+ def,def blank?
35
+ false
36
+ end,blank?
37
+ def,def bytes
38
+ self
39
+ end,bytes
40
+ def,"def days
41
+ ActiveSupport::Duration.new(self * 24.hours, [[:days, self]])
42
+ end",days
43
+ def,def duplicable?
44
+ false
45
+ end,duplicable?
46
+ def,def exabytes
47
+ self * EXABYTE
48
+ end,exabytes
49
+ def,"def fortnights
50
+ ActiveSupport::Duration.new(self * 2.weeks, [[:days, self * 14]])
51
+ end",fortnights
52
+ def,def gigabytes
53
+ self * GIGABYTE
54
+ end,gigabytes
55
+ def,"def hours
56
+ ActiveSupport::Duration.new(self * 3600, [[:seconds, self * 3600]])
57
+ end",hours
58
+ def,def html_safe?
59
+ true
60
+ end,html_safe?
61
+ def,def in_milliseconds
62
+ self * 1000
63
+ end,in_milliseconds
64
+ def,def kilobytes
65
+ self * KILOBYTE
66
+ end,kilobytes
67
+ def,def megabytes
68
+ self * MEGABYTE
69
+ end,megabytes
70
+ def,"def minutes
71
+ ActiveSupport::Duration.new(self * 60, [[:seconds, self * 60]])
72
+ end",minutes
73
+ def,def petabytes
74
+ self * PETABYTE
75
+ end,petabytes
76
+ def,"def seconds
77
+ ActiveSupport::Duration.new(self, [[:seconds, self]])
78
+ end",seconds
79
+ def,def terabytes
80
+ self * TERABYTE
81
+ end,terabytes
82
+ def,"def weeks
83
+ ActiveSupport::Duration.new(self * 7.days, [[:days, self * 7]])
84
+ end",weeks
85
+ optarg,options = nil,options
86
+ sym,:byte,
87
+ sym,:bytes,
88
+ sym,:day,
89
+ sym,:days,
90
+ sym,:days,
91
+ sym,:days,
92
+ sym,:days,
93
+ sym,:exabyte,
94
+ sym,:exabytes,
95
+ sym,:fortnight,
96
+ sym,:fortnights,
97
+ sym,:gigabyte,
98
+ sym,:gigabytes,
99
+ sym,:hour,
100
+ sym,:hours,
101
+ sym,:kilobyte,
102
+ sym,:kilobytes,
103
+ sym,:megabyte,
104
+ sym,:megabytes,
105
+ sym,:minute,
106
+ sym,:minutes,
107
+ sym,:petabyte,
108
+ sym,:petabytes,
109
+ sym,:second,
110
+ sym,:seconds,
111
+ sym,:seconds,
112
+ sym,:seconds,
113
+ sym,:seconds,
114
+ sym,:terabyte,
115
+ sym,:terabytes,
116
+ sym,:week,
117
+ sym,:weeks,
@@ -0,0 +1,31 @@
1
+ line,method,arguments,return_object
2
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/lazy_load_hooks.rb:42,#<Class:ActiveSupport>#run_load_hooks,"[""base: Object (Class)"",""name: :i18n (Symbol)""]",[] (Array)
3
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/i18n-0.7.0/lib/i18n.rb:30,#<Module:0x007ffc348e7460>#load_path,[],[] (Array)
4
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/i18n-0.7.0/lib/i18n.rb:17,#<Module:0x007ffc348e7460>#config,[],#<I18n::Config:0x007ffc33c096f8> (I18n::Config)
5
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/i18n-0.7.0/lib/i18n/config.rb:119,I18n::Config#load_path,[],[] (Array)
6
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/thread_safe-0.3.5/lib/thread_safe/cache.rb:26,ThreadSafe::Cache#initialize,"[""block: nil (NilClass)""]",nil (NilClass)
7
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/thread_safe-0.3.5/lib/thread_safe/non_concurrent_cache_backend.rb:7,ThreadSafe::NonConcurrentCacheBackend#initialize,"[""options: nil (NilClass)""]",{} (Hash)
8
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:203,ActiveSupport::Inflector#inflections,"[""locale: :en (Symbol)""]","[""equipment"", ""information"", ""rice"", ""money"", ""species"", ""series"", ""fish"", ""sheep"", ""jeans"", ""police""] (Array)"
9
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:30,#<Class:ActiveSupport::Inflector::Inflections>#instance,"[""locale: :en (Symbol)""]",#<ActiveSupport::Inflector::Inflections:0x007ffc34987c30> (ActiveSupport::Inflector::Inflections)
10
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/thread_safe-0.3.5/lib/thread_safe/cache.rb:37,ThreadSafe::Cache#[],"[""key: :en (Symbol)""]",nil (NilClass)
11
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/thread_safe-0.3.5/lib/thread_safe/non_concurrent_cache_backend.rb:11,ThreadSafe::NonConcurrentCacheBackend#[],"[""key: :en (Symbol)""]",nil (NilClass)
12
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:36,ActiveSupport::Inflector::Inflections#initialize,[],"[[], [], [], [], {}, /(?=a)b/] (Array)"
13
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/thread_safe-0.3.5/lib/thread_safe/mri_cache_backend.rb:21,ThreadSafe::MriCacheBackend#[]=,"[""value: #<ActiveSupport::Inflector::Inflections:0x007ffc34987c30> (ActiveSupport::Inflector::Inflections)"",""key: :en (Symbol)""]",#<ActiveSupport::Inflector::Inflections:0x007ffc34987c30> (ActiveSupport::Inflector::Inflections)
14
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/thread_safe-0.3.5/lib/thread_safe/non_concurrent_cache_backend.rb:15,ThreadSafe::NonConcurrentCacheBackend#[]=,"[""key: :en (Symbol)"",""value: #<ActiveSupport::Inflector::Inflections:0x007ffc34987c30> (ActiveSupport::Inflector::Inflections)""]",#<ActiveSupport::Inflector::Inflections:0x007ffc34987c30> (ActiveSupport::Inflector::Inflections)
15
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""rule: /$/ (Regexp)"",""replacement: \""s\"" (String)""]",[] (Array)
16
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""rule: /s$/i (Regexp)"",""replacement: \""s\"" (String)""]",[] (Array)
17
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""replacement: \""\\\\1es\"" (String)"",""rule: /^(ax|test)is$/i (Regexp)""]",[] (Array)
18
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""replacement: \""\\\\1i\"" (String)"",""rule: /(octop|vir)us$/i (Regexp)""]",[] (Array)
19
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""rule: /(octop|vir)i$/i (Regexp)"",""replacement: \""\\\\1i\"" (String)""]",[] (Array)
20
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""replacement: \""\\\\1es\"" (String)"",""rule: /(alias|status)$/i (Regexp)""]",[] (Array)
21
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""rule: /(bu)s$/i (Regexp)"",""replacement: \""\\\\1ses\"" (String)""]",[] (Array)
22
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""rule: /(buffal|tomat)o$/i (Regexp)"",""replacement: \""\\\\1oes\"" (String)""]",[] (Array)
23
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""replacement: \""\\\\1a\"" (String)"",""rule: /([ti])um$/i (Regexp)""]",[] (Array)
24
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""replacement: \""\\\\1a\"" (String)"",""rule: /([ti])a$/i (Regexp)""]",[] (Array)
25
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""replacement: \""ses\"" (String)"",""rule: /sis$/i (Regexp)""]",[] (Array)
26
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""replacement: \""\\\\1\\\\2ves\"" (String)"",""rule: /(?:([^f])fe|([lr])f)$/i (Regexp)""]",[] (Array)
27
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""rule: /(hive)$/i (Regexp)"",""replacement: \""\\\\1s\"" (String)""]",[] (Array)
28
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""rule: /([^aeiouy]|qu)y$/i (Regexp)"",""replacement: \""\\\\1ies\"" (String)""]",[] (Array)
29
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""replacement: \""\\\\1es\"" (String)"",""rule: /(x|ch|ss|sh)$/i (Regexp)""]",[] (Array)
30
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""rule: /(matr|vert|ind)(?:ix|ex)$/i (Regexp)"",""replacement: \""\\\\1ices\"" (String)""]",[] (Array)
31
+ /Users/brian/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/inflector/inflections.rb:105,ActiveSupport::Inflector::Inflections#plural,"[""replacement: \""\\\\1ice\"" (String)"",""rule: /^(m|l)ouse$/i (Regexp)""]",[] (Array)