zapata 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +3 -0
  4. data/CONTRIBUTING.md +5 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE +22 -0
  7. data/README.md +152 -0
  8. data/Rakefile +2 -0
  9. data/bin/zapata +20 -0
  10. data/lib/zapata.rb +91 -0
  11. data/lib/zapata/analyst.rb +34 -0
  12. data/lib/zapata/core/collector.rb +9 -0
  13. data/lib/zapata/core/loader.rb +38 -0
  14. data/lib/zapata/core/reader.rb +10 -0
  15. data/lib/zapata/core/writer.rb +33 -0
  16. data/lib/zapata/db.rb +32 -0
  17. data/lib/zapata/diver.rb +81 -0
  18. data/lib/zapata/predictor/args.rb +94 -0
  19. data/lib/zapata/predictor/chooser.rb +27 -0
  20. data/lib/zapata/primitive/arg.rb +24 -0
  21. data/lib/zapata/primitive/array.rb +39 -0
  22. data/lib/zapata/primitive/base.rb +28 -0
  23. data/lib/zapata/primitive/basic.rb +22 -0
  24. data/lib/zapata/primitive/casgn.rb +15 -0
  25. data/lib/zapata/primitive/const.rb +15 -0
  26. data/lib/zapata/primitive/def.rb +33 -0
  27. data/lib/zapata/primitive/defs.rb +32 -0
  28. data/lib/zapata/primitive/hash.rb +31 -0
  29. data/lib/zapata/primitive/ivar.rb +6 -0
  30. data/lib/zapata/primitive/klass.rb +34 -0
  31. data/lib/zapata/primitive/lvar.rb +24 -0
  32. data/lib/zapata/primitive/missing.rb +17 -0
  33. data/lib/zapata/primitive/modul.rb +20 -0
  34. data/lib/zapata/primitive/nil.rb +16 -0
  35. data/lib/zapata/primitive/optarg.rb +18 -0
  36. data/lib/zapata/primitive/raw.rb +16 -0
  37. data/lib/zapata/primitive/send.rb +48 -0
  38. data/lib/zapata/primitive/sklass.rb +20 -0
  39. data/lib/zapata/primitive/var.rb +25 -0
  40. data/lib/zapata/printer.rb +93 -0
  41. data/lib/zapata/rzpec/runner.rb +67 -0
  42. data/lib/zapata/rzpec/writer.rb +115 -0
  43. data/lib/zapata/version.rb +3 -0
  44. data/spec/array_spec.rb +37 -0
  45. data/spec/definition_spec.rb +43 -0
  46. data/spec/hash_spec.rb +43 -0
  47. data/spec/klass_types_spec.rb +55 -0
  48. data/spec/send_spec.rb +31 -0
  49. data/spec/simple_types_spec.rb +90 -0
  50. data/spec/spec_helper.rb +124 -0
  51. data/spec/support/rails_test_app/.gitignore +16 -0
  52. data/spec/support/rails_test_app/.rspec +3 -0
  53. data/spec/support/rails_test_app/Gemfile +45 -0
  54. data/spec/support/rails_test_app/Gemfile.lock +200 -0
  55. data/spec/support/rails_test_app/README.md +3 -0
  56. data/spec/support/rails_test_app/Rakefile +6 -0
  57. data/spec/support/rails_test_app/app/assets/images/.keep +0 -0
  58. data/spec/support/rails_test_app/app/assets/javascripts/application.js +16 -0
  59. data/spec/support/rails_test_app/app/assets/stylesheets/application.css +15 -0
  60. data/spec/support/rails_test_app/app/controllers/application_controller.rb +5 -0
  61. data/spec/support/rails_test_app/app/controllers/concerns/.keep +0 -0
  62. data/spec/support/rails_test_app/app/helpers/application_helper.rb +2 -0
  63. data/spec/support/rails_test_app/app/mailers/.keep +0 -0
  64. data/spec/support/rails_test_app/app/models/.keep +0 -0
  65. data/spec/support/rails_test_app/app/models/concerns/.keep +0 -0
  66. data/spec/support/rails_test_app/app/models/robot_to_test.rb +49 -0
  67. data/spec/support/rails_test_app/app/models/test_array.rb +34 -0
  68. data/spec/support/rails_test_app/app/models/test_const.rb +14 -0
  69. data/spec/support/rails_test_app/app/models/test_definition.rb +38 -0
  70. data/spec/support/rails_test_app/app/models/test_float.rb +14 -0
  71. data/spec/support/rails_test_app/app/models/test_hash.rb +39 -0
  72. data/spec/support/rails_test_app/app/models/test_int.rb +14 -0
  73. data/spec/support/rails_test_app/app/models/test_send.rb +75 -0
  74. data/spec/support/rails_test_app/app/models/test_str.rb +14 -0
  75. data/spec/support/rails_test_app/app/models/test_sym.rb +14 -0
  76. data/spec/support/rails_test_app/app/models/testing_module/bare.rb +6 -0
  77. data/spec/support/rails_test_app/app/models/testing_module/klass_methods.rb +47 -0
  78. data/spec/support/rails_test_app/app/models/testing_module/nested/inside.rb +8 -0
  79. data/spec/support/rails_test_app/app/views/layouts/application.html.erb +14 -0
  80. data/spec/support/rails_test_app/config.ru +4 -0
  81. data/spec/support/rails_test_app/config/application.rb +23 -0
  82. data/spec/support/rails_test_app/config/boot.rb +4 -0
  83. data/spec/support/rails_test_app/config/database.yml +25 -0
  84. data/spec/support/rails_test_app/config/environment.rb +5 -0
  85. data/spec/support/rails_test_app/config/environments/development.rb +37 -0
  86. data/spec/support/rails_test_app/config/environments/production.rb +83 -0
  87. data/spec/support/rails_test_app/config/environments/test.rb +39 -0
  88. data/spec/support/rails_test_app/config/initializers/backtrace_silencers.rb +7 -0
  89. data/spec/support/rails_test_app/config/initializers/cookies_serializer.rb +3 -0
  90. data/spec/support/rails_test_app/config/initializers/filter_parameter_logging.rb +4 -0
  91. data/spec/support/rails_test_app/config/initializers/inflections.rb +16 -0
  92. data/spec/support/rails_test_app/config/initializers/mime_types.rb +4 -0
  93. data/spec/support/rails_test_app/config/initializers/session_store.rb +3 -0
  94. data/spec/support/rails_test_app/config/initializers/wrap_parameters.rb +14 -0
  95. data/spec/support/rails_test_app/config/locales/en.yml +23 -0
  96. data/spec/support/rails_test_app/config/routes.rb +56 -0
  97. data/spec/support/rails_test_app/config/secrets.yml +22 -0
  98. data/spec/support/rails_test_app/db/seeds.rb +7 -0
  99. data/spec/support/rails_test_app/lib/assets/.keep +0 -0
  100. data/spec/support/rails_test_app/lib/tasks/.keep +0 -0
  101. data/spec/support/rails_test_app/log/.keep +0 -0
  102. data/spec/support/rails_test_app/public/404.html +67 -0
  103. data/spec/support/rails_test_app/public/422.html +67 -0
  104. data/spec/support/rails_test_app/public/500.html +66 -0
  105. data/spec/support/rails_test_app/public/favicon.ico +0 -0
  106. data/spec/support/rails_test_app/public/robots.txt +5 -0
  107. data/spec/support/rails_test_app/spec/models/robot_to_test_spec.rb +33 -0
  108. data/spec/support/rails_test_app/spec/models/test_array_spec.rb +27 -0
  109. data/spec/support/rails_test_app/spec/models/test_const_spec.rb +11 -0
  110. data/spec/support/rails_test_app/spec/models/test_definition_spec.rb +31 -0
  111. data/spec/support/rails_test_app/spec/models/test_float_spec.rb +11 -0
  112. data/spec/support/rails_test_app/spec/models/test_hash_spec.rb +31 -0
  113. data/spec/support/rails_test_app/spec/models/test_int_spec.rb +11 -0
  114. data/spec/support/rails_test_app/spec/models/test_send_spec.rb +53 -0
  115. data/spec/support/rails_test_app/spec/models/test_str_spec.rb +11 -0
  116. data/spec/support/rails_test_app/spec/models/test_sym_spec.rb +11 -0
  117. data/spec/support/rails_test_app/spec/models/testing_module/bare_spec.rb +7 -0
  118. data/spec/support/rails_test_app/spec/models/testing_module/klass_methods_spec.rb +19 -0
  119. data/spec/support/rails_test_app/spec/models/testing_module/nested/inside_spec.rb +7 -0
  120. data/spec/support/rails_test_app/spec/rails_helper.rb +43 -0
  121. data/spec/support/rails_test_app/spec/spec_helper.rb +78 -0
  122. data/spec/support/rails_test_app/test/controllers/.keep +0 -0
  123. data/spec/support/rails_test_app/test/fixtures/.keep +0 -0
  124. data/spec/support/rails_test_app/test/helpers/.keep +0 -0
  125. data/spec/support/rails_test_app/test/integration/.keep +0 -0
  126. data/spec/support/rails_test_app/test/mailers/.keep +0 -0
  127. data/spec/support/rails_test_app/test/models/.keep +0 -0
  128. data/spec/support/rails_test_app/test/test_helper.rb +13 -0
  129. data/spec/support/rails_test_app/vendor/assets/javascripts/.keep +0 -0
  130. data/spec/support/rails_test_app/vendor/assets/stylesheets/.keep +0 -0
  131. data/zapata.gemspec +34 -0
  132. metadata +446 -0
@@ -0,0 +1,16 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
@@ -0,0 +1,3 @@
1
+ --color
2
+ --warnings
3
+ --require spec_helper
@@ -0,0 +1,45 @@
1
+ source 'https://rubygems.org'
2
+
3
+
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.1.1'
6
+ # Use sqlite3 as the database for Active Record
7
+ gem 'sqlite3'
8
+ # Use SCSS for stylesheets
9
+ gem 'sass-rails', '~> 4.0.3'
10
+ # Use Uglifier as compressor for JavaScript assets
11
+ gem 'uglifier', '>= 1.3.0'
12
+ # Use CoffeeScript for .js.coffee assets and views
13
+ gem 'coffee-rails', '~> 4.0.0'
14
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
15
+ # gem 'therubyracer', platforms: :ruby
16
+
17
+ # Use jquery as the JavaScript library
18
+ gem 'jquery-rails'
19
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20
+ gem 'turbolinks'
21
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22
+ gem 'jbuilder', '~> 2.0'
23
+ # bundle exec rake doc:rails generates the API under doc/api.
24
+ gem 'sdoc', '~> 0.4.0', group: :doc
25
+
26
+ group :development, :test do
27
+ gem 'rspec-rails'
28
+ end
29
+
30
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
31
+ gem 'spring', group: :development
32
+
33
+ gem 'zapata', path: '~/Developer/zapata'
34
+
35
+ # Use ActiveModel has_secure_password
36
+ # gem 'bcrypt', '~> 3.1.7'
37
+
38
+ # Use unicorn as the app server
39
+ # gem 'unicorn'
40
+
41
+ # Use Capistrano for deployment
42
+ # gem 'capistrano-rails', group: :development
43
+
44
+ # Use debugger
45
+ # gem 'debugger', group: [:development, :test]
@@ -0,0 +1,200 @@
1
+ PATH
2
+ remote: ~/Developer/zapata
3
+ specs:
4
+ zapata (0.0.1)
5
+ andand (~> 1.3)
6
+ file-temp (~> 1.2)
7
+ parser (~> 2.1)
8
+ pry (~> 0.9)
9
+ pry-stack_explorer (~> 0.4)
10
+ rails (>= 3.0.0)
11
+ require_all (~> 1.3)
12
+ rspec-rails (~> 3.0)
13
+ slop (~> 3.4)
14
+ unparser (~> 0.1)
15
+
16
+ GEM
17
+ remote: https://rubygems.org/
18
+ specs:
19
+ abstract_type (0.0.7)
20
+ actionmailer (4.1.1)
21
+ actionpack (= 4.1.1)
22
+ actionview (= 4.1.1)
23
+ mail (~> 2.5.4)
24
+ actionpack (4.1.1)
25
+ actionview (= 4.1.1)
26
+ activesupport (= 4.1.1)
27
+ rack (~> 1.5.2)
28
+ rack-test (~> 0.6.2)
29
+ actionview (4.1.1)
30
+ activesupport (= 4.1.1)
31
+ builder (~> 3.1)
32
+ erubis (~> 2.7.0)
33
+ activemodel (4.1.1)
34
+ activesupport (= 4.1.1)
35
+ builder (~> 3.1)
36
+ activerecord (4.1.1)
37
+ activemodel (= 4.1.1)
38
+ activesupport (= 4.1.1)
39
+ arel (~> 5.0.0)
40
+ activesupport (4.1.1)
41
+ i18n (~> 0.6, >= 0.6.9)
42
+ json (~> 1.7, >= 1.7.7)
43
+ minitest (~> 5.1)
44
+ thread_safe (~> 0.1)
45
+ tzinfo (~> 1.1)
46
+ adamantium (0.2.0)
47
+ ice_nine (~> 0.11.0)
48
+ memoizable (~> 0.4.0)
49
+ andand (1.3.3)
50
+ arel (5.0.1.20140414130214)
51
+ ast (2.0.0)
52
+ binding_of_caller (0.7.2)
53
+ debug_inspector (>= 0.0.1)
54
+ builder (3.2.2)
55
+ coderay (1.1.0)
56
+ coffee-rails (4.0.1)
57
+ coffee-script (>= 2.2.0)
58
+ railties (>= 4.0.0, < 5.0)
59
+ coffee-script (2.3.0)
60
+ coffee-script-source
61
+ execjs
62
+ coffee-script-source (1.7.1)
63
+ concord (0.1.5)
64
+ adamantium (~> 0.2.0)
65
+ equalizer (~> 0.0.9)
66
+ debug_inspector (0.0.2)
67
+ diff-lcs (1.2.5)
68
+ equalizer (0.0.9)
69
+ erubis (2.7.0)
70
+ execjs (2.2.1)
71
+ ffi (1.9.3)
72
+ file-temp (1.2.1)
73
+ ffi (>= 1.0.0)
74
+ hike (1.2.3)
75
+ i18n (0.6.11)
76
+ ice_nine (0.11.0)
77
+ jbuilder (2.1.3)
78
+ activesupport (>= 3.0.0, < 5)
79
+ multi_json (~> 1.2)
80
+ jquery-rails (3.1.1)
81
+ railties (>= 3.0, < 5.0)
82
+ thor (>= 0.14, < 2.0)
83
+ json (1.8.1)
84
+ mail (2.5.4)
85
+ mime-types (~> 1.16)
86
+ treetop (~> 1.4.8)
87
+ memoizable (0.4.2)
88
+ thread_safe (~> 0.3, >= 0.3.1)
89
+ method_source (0.8.2)
90
+ mime-types (1.25.1)
91
+ minitest (5.4.0)
92
+ multi_json (1.10.1)
93
+ parser (2.1.9)
94
+ ast (>= 1.1, < 3.0)
95
+ slop (~> 3.4, >= 3.4.5)
96
+ polyglot (0.3.5)
97
+ procto (0.0.2)
98
+ pry (0.10.0)
99
+ coderay (~> 1.1.0)
100
+ method_source (~> 0.8.1)
101
+ slop (~> 3.4)
102
+ pry-stack_explorer (0.4.9.1)
103
+ binding_of_caller (>= 0.7)
104
+ pry (>= 0.9.11)
105
+ rack (1.5.2)
106
+ rack-test (0.6.2)
107
+ rack (>= 1.0)
108
+ rails (4.1.1)
109
+ actionmailer (= 4.1.1)
110
+ actionpack (= 4.1.1)
111
+ actionview (= 4.1.1)
112
+ activemodel (= 4.1.1)
113
+ activerecord (= 4.1.1)
114
+ activesupport (= 4.1.1)
115
+ bundler (>= 1.3.0, < 2.0)
116
+ railties (= 4.1.1)
117
+ sprockets-rails (~> 2.0)
118
+ railties (4.1.1)
119
+ actionpack (= 4.1.1)
120
+ activesupport (= 4.1.1)
121
+ rake (>= 0.8.7)
122
+ thor (>= 0.18.1, < 2.0)
123
+ rake (10.3.2)
124
+ rdoc (4.1.1)
125
+ json (~> 1.4)
126
+ require_all (1.3.2)
127
+ rspec-core (3.0.3)
128
+ rspec-support (~> 3.0.0)
129
+ rspec-expectations (3.0.3)
130
+ diff-lcs (>= 1.2.0, < 2.0)
131
+ rspec-support (~> 3.0.0)
132
+ rspec-mocks (3.0.3)
133
+ rspec-support (~> 3.0.0)
134
+ rspec-rails (3.0.2)
135
+ actionpack (>= 3.0)
136
+ activesupport (>= 3.0)
137
+ railties (>= 3.0)
138
+ rspec-core (~> 3.0.0)
139
+ rspec-expectations (~> 3.0.0)
140
+ rspec-mocks (~> 3.0.0)
141
+ rspec-support (~> 3.0.0)
142
+ rspec-support (3.0.3)
143
+ sass (3.2.19)
144
+ sass-rails (4.0.3)
145
+ railties (>= 4.0.0, < 5.0)
146
+ sass (~> 3.2.0)
147
+ sprockets (~> 2.8, <= 2.11.0)
148
+ sprockets-rails (~> 2.0)
149
+ sdoc (0.4.0)
150
+ json (~> 1.8)
151
+ rdoc (~> 4.0, < 5.0)
152
+ slop (3.6.0)
153
+ spring (1.1.3)
154
+ sprockets (2.11.0)
155
+ hike (~> 1.2)
156
+ multi_json (~> 1.0)
157
+ rack (~> 1.0)
158
+ tilt (~> 1.1, != 1.3.0)
159
+ sprockets-rails (2.1.3)
160
+ actionpack (>= 3.0)
161
+ activesupport (>= 3.0)
162
+ sprockets (~> 2.8)
163
+ sqlite3 (1.3.9)
164
+ thor (0.19.1)
165
+ thread_safe (0.3.4)
166
+ tilt (1.4.1)
167
+ treetop (1.4.15)
168
+ polyglot
169
+ polyglot (>= 0.3.1)
170
+ turbolinks (2.2.2)
171
+ coffee-rails
172
+ tzinfo (1.2.1)
173
+ thread_safe (~> 0.1)
174
+ uglifier (2.5.3)
175
+ execjs (>= 0.3.0)
176
+ json (>= 1.8.0)
177
+ unparser (0.1.14)
178
+ abstract_type (~> 0.0.7)
179
+ adamantium (~> 0.2.0)
180
+ concord (~> 0.1.5)
181
+ equalizer (~> 0.0.9)
182
+ parser (~> 2.1)
183
+ procto (~> 0.0.2)
184
+
185
+ PLATFORMS
186
+ ruby
187
+
188
+ DEPENDENCIES
189
+ coffee-rails (~> 4.0.0)
190
+ jbuilder (~> 2.0)
191
+ jquery-rails
192
+ rails (= 4.1.1)
193
+ rspec-rails
194
+ sass-rails (~> 4.0.3)
195
+ sdoc (~> 0.4.0)
196
+ spring
197
+ sqlite3
198
+ turbolinks
199
+ uglifier (>= 1.3.0)
200
+ zapata!
@@ -0,0 +1,3 @@
1
+ # Zapata Rails test
2
+
3
+ Just a testing app for [Zapata gem](https://github.com/Nedomas/zapata)
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,16 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,49 @@
1
+ class RobotToTest
2
+ def initialize(human_name, cv)
3
+ @name = robot_name(human_name)
4
+ end
5
+
6
+ def robot_name(human_name)
7
+ "#{self.class.prefix}_#{human_name}"
8
+ end
9
+
10
+ def cv
11
+ { planets: planets }
12
+ end
13
+
14
+ def nested_fun_objects(fun_objects)
15
+ 'It was fun'
16
+ end
17
+
18
+ def self.prefix
19
+ 'Robot'
20
+ end
21
+
22
+ private
23
+
24
+ def planets
25
+ ['Mars', Human.home]
26
+ end
27
+
28
+ def fun_objects
29
+ [%i(array in array), { hash: nested_hash }]
30
+ end
31
+
32
+ def nested_hash
33
+ { in_hash: { in: array } }
34
+ end
35
+
36
+ def array
37
+ %w(array)
38
+ end
39
+ end
40
+
41
+ class Human
42
+ def initialize
43
+ human_name = 'Emiliano'
44
+ end
45
+
46
+ def self.home
47
+ 'Earth'
48
+ end
49
+ end
@@ -0,0 +1,34 @@
1
+ class TestArray
2
+ def initialize
3
+ end
4
+
5
+ def test_in_arg(numbers_array)
6
+ numbers_array
7
+ end
8
+
9
+ def test_nested_one_level(nested_one_level)
10
+ nested_one_level
11
+ end
12
+
13
+ def test_nested_two_levels(nested_two_levels)
14
+ nested_two_levels
15
+ end
16
+
17
+ def test_nested_three_levels(nested_three_levels)
18
+ nested_three_levels
19
+ end
20
+
21
+ def test_hash_nested(hash_nested)
22
+ hash_nested
23
+ end
24
+
25
+ private
26
+
27
+ def data_to_analyze
28
+ numbers_array = [2, 7.1, 8]
29
+ nested_one_level = [numbers_array, :mexico]
30
+ nested_two_levels = [nested_one_level, numbers_array, :mexico]
31
+ nested_three_levels = [nested_two_levels, nested_one_level, numbers_array, :mexico]
32
+ hash_nested = [{ emiliano: numbers_array }]
33
+ end
34
+ end
@@ -0,0 +1,14 @@
1
+ class TestConst
2
+ def initialize
3
+ end
4
+
5
+ def test_const_in_arg(const)
6
+ const
7
+ end
8
+
9
+ private
10
+
11
+ def data_to_analyze
12
+ const = TestConst
13
+ end
14
+ end
@@ -0,0 +1,38 @@
1
+ class TestDefinition
2
+ def in_optional_args(optional = :audioslave)
3
+ optional
4
+ end
5
+
6
+ def use_optional(optional)
7
+ optional
8
+ end
9
+
10
+ def var_in_optional_args(optional_var = fallback)
11
+ optional_var
12
+ end
13
+
14
+ def method_in_optional_args(optional_method = fall_meth)
15
+ optional_method
16
+ end
17
+
18
+ def call_method_result_in_optional_args(complex_method = fall_meth.first)
19
+ complex_method
20
+ end
21
+
22
+ def should_not_show_empty_method
23
+ end
24
+
25
+ def recursive_method
26
+ recursive_method
27
+ end
28
+
29
+ private
30
+
31
+ def fall_meth
32
+ 'I am falling'
33
+ end
34
+
35
+ def data_to_analyze
36
+ fallback = 'Chuck'
37
+ end
38
+ end