archruby 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +32 -0
- data/Rakefile +1 -0
- data/archruby.gemspec +28 -0
- data/bin/archruby +20 -0
- data/bin/constraints_breaks.yml +29 -0
- data/constraints_breaks.yml +22 -0
- data/lib/archruby.rb +47 -0
- data/lib/archruby/architecture/architecture.rb +83 -0
- data/lib/archruby/architecture/config_definition.rb +66 -0
- data/lib/archruby/architecture/constraint_break.rb +22 -0
- data/lib/archruby/architecture/dependency.rb +11 -0
- data/lib/archruby/architecture/file_content.rb +24 -0
- data/lib/archruby/architecture/module_definition.rb +218 -0
- data/lib/archruby/architecture/parser.rb +58 -0
- data/lib/archruby/presenters/graph.rb +132 -0
- data/lib/archruby/presenters/text.rb +14 -0
- data/lib/archruby/presenters/yaml.rb +28 -0
- data/lib/archruby/ruby/core_library.rb +26 -0
- data/lib/archruby/ruby/parser.rb +409 -0
- data/lib/archruby/ruby/std_library.rb +22 -0
- data/lib/archruby/ruby/var_propagation.rb +46 -0
- data/lib/archruby/version.rb +3 -0
- data/spec/architecture/architecture_spec.rb +48 -0
- data/spec/architecture/config_definition_spec.rb +20 -0
- data/spec/architecture/constraint_break_spec.rb +22 -0
- data/spec/architecture/file_content_spec.rb +12 -0
- data/spec/architecture/module_definition_spec.rb +70 -0
- data/spec/architecture/parser_spec.rb +11 -0
- data/spec/archruby_spec.rb +10 -0
- data/spec/dummy_app/.gitignore +16 -0
- data/spec/dummy_app/Gemfile +45 -0
- data/spec/dummy_app/README.rdoc +28 -0
- data/spec/dummy_app/Rakefile +6 -0
- data/spec/dummy_app/app/assets/images/.keep +0 -0
- data/spec/dummy_app/app/assets/javascripts/application.js +16 -0
- data/spec/dummy_app/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy_app/app/controllers/application_controller.rb +17 -0
- data/spec/dummy_app/app/controllers/concerns/.keep +0 -0
- data/spec/dummy_app/app/helpers/application_helper.rb +2 -0
- data/spec/dummy_app/app/mailers/.keep +0 -0
- data/spec/dummy_app/app/models/.keep +0 -0
- data/spec/dummy_app/app/models/concerns/.keep +0 -0
- data/spec/dummy_app/app/models/module_test.rb +5 -0
- data/spec/dummy_app/app/models/teste.rb +11 -0
- data/spec/dummy_app/app/models/user.rb +9 -0
- data/spec/dummy_app/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy_app/app/views/view_test.rb +5 -0
- data/spec/dummy_app/bin/bundle +3 -0
- data/spec/dummy_app/bin/rails +4 -0
- data/spec/dummy_app/bin/rake +4 -0
- data/spec/dummy_app/config.ru +4 -0
- data/spec/dummy_app/config/application.rb +23 -0
- data/spec/dummy_app/config/boot.rb +4 -0
- data/spec/dummy_app/config/database.yml +25 -0
- data/spec/dummy_app/config/environment.rb +5 -0
- data/spec/dummy_app/config/environments/development.rb +29 -0
- data/spec/dummy_app/config/environments/production.rb +80 -0
- data/spec/dummy_app/config/environments/test.rb +36 -0
- data/spec/dummy_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy_app/config/initializers/inflections.rb +16 -0
- data/spec/dummy_app/config/initializers/mime_types.rb +5 -0
- data/spec/dummy_app/config/initializers/secret_token.rb +12 -0
- data/spec/dummy_app/config/initializers/session_store.rb +3 -0
- data/spec/dummy_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy_app/config/locales/en.yml +23 -0
- data/spec/dummy_app/config/routes.rb +56 -0
- data/spec/dummy_app/db/seeds.rb +7 -0
- data/spec/dummy_app/lib/assets/.keep +0 -0
- data/spec/dummy_app/lib/fetch_facebook_info.rb +7 -0
- data/spec/dummy_app/lib/integracao_twitter.rb +5 -0
- data/spec/dummy_app/lib/tasks/.keep +0 -0
- data/spec/dummy_app/log/.keep +0 -0
- data/spec/dummy_app/public/404.html +58 -0
- data/spec/dummy_app/public/422.html +58 -0
- data/spec/dummy_app/public/500.html +57 -0
- data/spec/dummy_app/public/favicon.ico +0 -0
- data/spec/dummy_app/public/robots.txt +5 -0
- data/spec/dummy_app/test/controllers/.keep +0 -0
- data/spec/dummy_app/test/fixtures/.keep +0 -0
- data/spec/dummy_app/test/helpers/.keep +0 -0
- data/spec/dummy_app/test/integration/.keep +0 -0
- data/spec/dummy_app/test/mailers/.keep +0 -0
- data/spec/dummy_app/test/models/.keep +0 -0
- data/spec/dummy_app/test/test_helper.rb +15 -0
- data/spec/dummy_app/vendor/assets/javascripts/.keep +0 -0
- data/spec/dummy_app/vendor/assets/stylesheets/.keep +0 -0
- data/spec/fixtures/new_arch_definition.yml +32 -0
- data/spec/fixtures/ruby_example.rb +74 -0
- data/spec/ruby/parser_spec.rb +45 -0
- data/spec/ruby/var_propagation_spec.rb +22 -0
- data/spec/spec_helper.rb +1 -0
- metadata +295 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
module Archruby
|
2
|
+
module Ruby
|
3
|
+
class VarPropagation
|
4
|
+
attr_reader :vars
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@vars = []
|
8
|
+
end
|
9
|
+
|
10
|
+
def push var_name, line_number, type = nil
|
11
|
+
var = find_var var_name
|
12
|
+
if var
|
13
|
+
lines = var[var.keys.first][:lines]
|
14
|
+
lines.push(line_number)
|
15
|
+
else
|
16
|
+
@vars.push(
|
17
|
+
{
|
18
|
+
var_name =>
|
19
|
+
{
|
20
|
+
:lines => [line_number],
|
21
|
+
:type => type
|
22
|
+
}
|
23
|
+
}
|
24
|
+
)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def put_type var_name, type
|
29
|
+
var = find_var var_name
|
30
|
+
if var
|
31
|
+
var[var.keys.first][:type] = type
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def find_var var_name
|
36
|
+
vars.each do | var |
|
37
|
+
if var.keys.first == var_name
|
38
|
+
return var
|
39
|
+
end
|
40
|
+
end
|
41
|
+
return nil
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Archruby::Architecture::Architecture do
|
4
|
+
let(:parser) { Archruby::Architecture::Parser.new(File.expand_path('../../fixtures/new_arch_definition.yml', __FILE__), File.expand_path('../../dummy_app/', __FILE__)) }
|
5
|
+
let(:architecture) { Archruby::Architecture::Architecture.new(parser.modules) }
|
6
|
+
|
7
|
+
it 'have an unknown_module' do
|
8
|
+
architecture.unknown_module.should_not be_nil
|
9
|
+
architecture.unknown_module.name.should be_eql("unknown")
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'detect the amount of architecture erosion correctly' do
|
13
|
+
architecture.verify
|
14
|
+
architecture.constraints_breaks.count.should == 5
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'raise and error if how_many_break is called without verify the architecture' do
|
18
|
+
lambda{ architecture.how_many_break("module_name", "module_target_name", "constraint_type") }.should raise_error(Archruby::ArchitectureNotVerified)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'return the amount of constraint breaks correctly' do
|
22
|
+
architecture.verify
|
23
|
+
puts architecture.constraints_breaks.inspect
|
24
|
+
controller_breaks = architecture.how_many_break "controller", "facebook", Archruby::Architecture::ConstraintBreak::DIVERGENCE
|
25
|
+
controller_breaks.should be_eql(1)
|
26
|
+
|
27
|
+
controller_breaks = architecture.how_many_break "model", "activerecord", Archruby::Architecture::ConstraintBreak::ABSENSE
|
28
|
+
controller_breaks.should be_eql(2)
|
29
|
+
|
30
|
+
controller_breaks = architecture.how_many_break "model", "facebook", Archruby::Architecture::ConstraintBreak::DIVERGENCE
|
31
|
+
controller_breaks.should be_eql(1)
|
32
|
+
|
33
|
+
controller_breaks = architecture.how_many_break "view", "model", Archruby::Architecture::ConstraintBreak::DIVERGENCE
|
34
|
+
controller_breaks.should be_eql(1)
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'return the module name correctly' do
|
38
|
+
architecture.module_name("ActionController").should be_eql("actioncontroller")
|
39
|
+
architecture.module_name("Koala").should be_eql("facebook")
|
40
|
+
architecture.module_name("User").should be_eql("model")
|
41
|
+
architecture.module_name("NAOTEMNAO").should be_eql(architecture.unknown_module.name)
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'return the correct amount of time that an module access another module' do
|
45
|
+
architecture.how_many_access_to("controller", "model").should be_eql(2)
|
46
|
+
architecture.how_many_access_to("model", "controller").should be_eql(1)
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Archruby::Architecture::ConfigDefinition do
|
4
|
+
let(:parsed_yaml) {YAML.load_file(File.expand_path('../../fixtures/new_arch_definition.yml', __FILE__))}
|
5
|
+
let(:mocked_yaml) { {"controller"=> {"files"=>"app/controllers/**/*.rb", "allowed"=>"model, integracao_twitter, facebook_looker, actioncontroller", "forbidden" => ["forbidden_module"]}} }
|
6
|
+
|
7
|
+
it 'return all information correctly' do
|
8
|
+
config_definition = Archruby::Architecture::ConfigDefinition.new 'controller', parsed_yaml['controller']
|
9
|
+
config_definition.files.count.should == 1
|
10
|
+
config_definition.gems.should be_empty
|
11
|
+
config_definition.required_modules.should be_empty
|
12
|
+
config_definition.forbidden_modules.should be_empty
|
13
|
+
config_definition.allowed_modules.should include("integracao_twitter")
|
14
|
+
config_definition.allowed_modules.should include("model")
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'throw an execption if allowed and forbidden is used thogheter' do
|
18
|
+
lambda { config_definition = Archruby::Architecture::ConfigDefinition.new 'controller', mocked_yaml['controller'] }.should raise_error(Archruby::MultipleConstraints)
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Archruby::Architecture::ConstraintBreak do
|
4
|
+
it "receive an hash of options and put it in the correct attributes" do
|
5
|
+
arch_break = Archruby::Architecture::ConstraintBreak.new({
|
6
|
+
:type => Archruby::Architecture::ConstraintBreak::ABSENSE,
|
7
|
+
:class_origin => "Teste",
|
8
|
+
:line_origin => 12,
|
9
|
+
:class_target => "Target",
|
10
|
+
:module_origin => "moduloOrig",
|
11
|
+
:module_target => "moduloTarg",
|
12
|
+
:msg => "MSG"
|
13
|
+
})
|
14
|
+
arch_break.type.should == Archruby::Architecture::ConstraintBreak::ABSENSE
|
15
|
+
arch_break.class_origin.should == "Teste"
|
16
|
+
arch_break.line_origin.should == 12
|
17
|
+
arch_break.class_target.should == "Target"
|
18
|
+
arch_break.module_origin.should == "moduloOrig"
|
19
|
+
arch_break.module_target.should == "moduloTarg"
|
20
|
+
arch_break.msg.should == "MSG"
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Archruby::Architecture::FileContent do
|
4
|
+
|
5
|
+
it 'get the content from the right files' do
|
6
|
+
file_reader = Archruby::Architecture::FileContent.new("/Users/sergiomiranda/Labs/ruby_arch_checker/arch_checker/spec/dummy_app/app/")
|
7
|
+
content = file_reader.all_content_from_directory "controllers/**/*.rb"
|
8
|
+
content.keys.should include('application_controller')
|
9
|
+
content['application_controller'].should_not be_nil
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Archruby::Architecture::ModuleDefinition do
|
4
|
+
let(:parsed_yaml) {YAML.load_file(File.expand_path('../../fixtures/new_arch_definition.yml', __FILE__))}
|
5
|
+
let(:parser) {Archruby::Architecture::Parser.new(File.expand_path('../../fixtures/new_arch_definition.yml', __FILE__), File.expand_path('../../dummy_app/', __FILE__)) }
|
6
|
+
|
7
|
+
it 'get file content correctly' do
|
8
|
+
base_directory = File.expand_path('../../dummy_app/', __FILE__)
|
9
|
+
config_definition = Archruby::Architecture::ConfigDefinition.new 'model', parsed_yaml['model']
|
10
|
+
module_definition = Archruby::Architecture::ModuleDefinition.new(config_definition, base_directory)
|
11
|
+
module_definition.classes.should include("Teste::Testando::VaiAcessar")
|
12
|
+
module_definition.classes.should include("Teste")
|
13
|
+
module_definition.classes.should include("User")
|
14
|
+
module_definition.dependencies.should include("ActiveRecord::Base")
|
15
|
+
module_definition.dependencies.should include("OutraClasse::De::Teste")
|
16
|
+
puts module_definition.classes_and_dependencies.first.should be_eql({})
|
17
|
+
module_definition.classes_and_dependencies[1].keys.should include("Teste")
|
18
|
+
module_definition.classes_and_dependencies.last.keys.should include("User")
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'build the dependencies correctly' do
|
22
|
+
base_directory = File.expand_path('../../dummy_app/', __FILE__)
|
23
|
+
config_definition = Archruby::Architecture::ConfigDefinition.new 'model', parsed_yaml['model']
|
24
|
+
module_definition = Archruby::Architecture::ModuleDefinition.new(config_definition, base_directory)
|
25
|
+
module_definition.dependencies.count.should be_eql(6)
|
26
|
+
module_definition.dependencies.should include("Koala::Facebook::API")
|
27
|
+
module_definition.dependencies.should include("OutraClasse::De::Teste")
|
28
|
+
module_definition.dependencies.should include("ActiveRecord::Base")
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'return true when the module has a particular class' do
|
32
|
+
base_directory = File.expand_path('../../dummy_app/', __FILE__)
|
33
|
+
config_definition = Archruby::Architecture::ConfigDefinition.new 'model', parsed_yaml['model']
|
34
|
+
module_definition = Archruby::Architecture::ModuleDefinition.new(config_definition, base_directory)
|
35
|
+
module_definition.is_mine?("Teste").should be_true
|
36
|
+
module_definition.is_mine?("User").should be_true
|
37
|
+
module_definition.is_mine?("ActiveRecord").should be_false
|
38
|
+
module_definition.is_mine?("QualquerCoisa").should be_false
|
39
|
+
module_definition.is_mine?("::User").should be_true
|
40
|
+
module_definition.is_mine?("::User::Nao::Sei").should be_false
|
41
|
+
module_definition.is_mine?("Testando::VaiAcessar").should be_true
|
42
|
+
|
43
|
+
config_definition = Archruby::Architecture::ConfigDefinition.new 'actioncontroller', parsed_yaml['actioncontroller']
|
44
|
+
module_definition = Archruby::Architecture::ModuleDefinition.new(config_definition, base_directory)
|
45
|
+
module_definition.is_mine?("ActionController::Base").should be_true
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'verify required constraint correctly' do
|
49
|
+
architecture = Archruby::Architecture::Architecture.new(parser.modules)
|
50
|
+
base_directory = File.expand_path('../../dummy_app/', __FILE__)
|
51
|
+
config_definition = Archruby::Architecture::ConfigDefinition.new 'model', parsed_yaml['model']
|
52
|
+
module_definition = Archruby::Architecture::ModuleDefinition.new(config_definition, base_directory)
|
53
|
+
required_breaks = module_definition.verify_required architecture
|
54
|
+
puts required_breaks.inspect
|
55
|
+
required_breaks.count.should == 2
|
56
|
+
required_breaks.first.class_origin.should == "Teste::Testando"
|
57
|
+
required_breaks.last.class_origin.should == "Teste"
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'verify forbidden constraint correctly' do
|
61
|
+
architecture = Archruby::Architecture::Architecture.new(parser.modules)
|
62
|
+
base_directory = File.expand_path('../../dummy_app/', __FILE__)
|
63
|
+
config_definition = Archruby::Architecture::ConfigDefinition.new 'view', parsed_yaml['view']
|
64
|
+
module_definition = Archruby::Architecture::ModuleDefinition.new(config_definition, base_directory)
|
65
|
+
forbidden_breaks = module_definition.verify_forbidden architecture
|
66
|
+
forbidden_breaks.count.should == 1
|
67
|
+
forbidden_breaks.first.class_origin.should == "ViewTest"
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Archruby::Architecture::Parser do
|
4
|
+
let(:parser) {Archruby::Architecture::Parser.new(File.expand_path('../../fixtures/new_arch_definition.yml', __FILE__), File.expand_path('../../dummy_app/', __FILE__)) }
|
5
|
+
|
6
|
+
it 'extract correct modules from architecture definition file' do
|
7
|
+
parser.modules.should_not be_empty
|
8
|
+
parser.modules.count.should be_eql(12)
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Archruby::ExtractArchitecture do
|
4
|
+
let(:arch_extractor) { Archruby::ExtractArchitecture.new("../../spec/fixtures/arch_definition.yml", "/Users/sergiomiranda/Labs/ruby_arch_checker/arch_checker/spec/dummy_app/") }
|
5
|
+
let(:dependencies) { arch_extractor.extract_classes_and_dependencies }
|
6
|
+
|
7
|
+
it '' do
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
@@ -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,45 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
4
|
+
gem 'rails', '4.0.2'
|
5
|
+
|
6
|
+
# Use sqlite3 as the database for Active Record
|
7
|
+
gem 'sqlite3'
|
8
|
+
|
9
|
+
# Use SCSS for stylesheets
|
10
|
+
gem 'sass-rails', '~> 4.0.0'
|
11
|
+
|
12
|
+
# Use Uglifier as compressor for JavaScript assets
|
13
|
+
gem 'uglifier', '>= 1.3.0'
|
14
|
+
|
15
|
+
# Use CoffeeScript for .js.coffee assets and views
|
16
|
+
gem 'coffee-rails', '~> 4.0.0'
|
17
|
+
|
18
|
+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
19
|
+
# gem 'therubyracer', platforms: :ruby
|
20
|
+
|
21
|
+
# Use jquery as the JavaScript library
|
22
|
+
gem 'jquery-rails'
|
23
|
+
|
24
|
+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
25
|
+
gem 'turbolinks'
|
26
|
+
|
27
|
+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
28
|
+
gem 'jbuilder', '~> 1.2'
|
29
|
+
|
30
|
+
group :doc do
|
31
|
+
# bundle exec rake doc:rails generates the API under doc/api.
|
32
|
+
gem 'sdoc', require: false
|
33
|
+
end
|
34
|
+
|
35
|
+
# Use ActiveModel has_secure_password
|
36
|
+
# gem 'bcrypt-ruby', '~> 3.1.2'
|
37
|
+
|
38
|
+
# Use unicorn as the app server
|
39
|
+
# gem 'unicorn'
|
40
|
+
|
41
|
+
# Use Capistrano for deployment
|
42
|
+
# gem 'capistrano', group: :development
|
43
|
+
|
44
|
+
# Use debugger
|
45
|
+
# gem 'debugger', group: [:development, :test]
|
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
File without changes
|
@@ -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,13 @@
|
|
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 top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require_tree .
|
13
|
+
*/
|
@@ -0,0 +1,17 @@
|
|
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
|
+
|
6
|
+
def break_facebook_looker
|
7
|
+
@graph = Koala::Facebook::API.new("access_token_qualquer")
|
8
|
+
end
|
9
|
+
|
10
|
+
def access_an_user_model
|
11
|
+
@users = User.all
|
12
|
+
end
|
13
|
+
|
14
|
+
def access_an_teste_model
|
15
|
+
@teste = Teste.new
|
16
|
+
end
|
17
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|