Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Employee engine created #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
/README.rdoc
config/initializers/secret_token.rb
config/database.yml
vendor/engines/employee/test/dummy/README.rdoc
vendor/engines/employee/test/dummy/config/initializers/secret_token.rb
vendor/engines/employee/test/dummy/config/mongoid.yml
vendor/engines/employee/test/dummy/log/*.log
vendor/engines/employee/test/dummy/tmp
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
Expand All @@ -43,3 +43,4 @@ end

# Use debugger
# gem 'debugger', group: [:development, :test]

8 changes: 7 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GEM
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.1)
arel (4.0.2)
atomic (1.1.14)
builder (3.1.4)
coffee-rails (4.0.1)
Expand All @@ -46,6 +46,7 @@ GEM
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
libv8 (3.16.14.3)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
Expand All @@ -72,6 +73,7 @@ GEM
rake (10.1.1)
rdoc (4.1.1)
json (~> 1.4)
ref (1.0.5)
sass (3.2.14)
sass-rails (4.0.1)
railties (>= 4.0.0, < 5.0)
Expand All @@ -90,6 +92,9 @@ GEM
activesupport (>= 3.0)
sprockets (~> 2.8)
sqlite3 (1.3.8)
therubyracer (0.12.1)
libv8 (~> 3.16.14.0)
ref
thor (0.18.1)
thread_safe (0.1.3)
atomic
Expand All @@ -115,5 +120,6 @@ DEPENDENCIES
sass-rails (~> 4.0.0)
sdoc
sqlite3
therubyracer
turbolinks
uglifier (>= 1.3.0)
9 changes: 9 additions & 0 deletions vendor/engines/employee/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.bundle/
log/*.log
pkg/
test/dummy/db/*.sqlite3
test/dummy/db/*.sqlite3-journal
test/dummy/log/*.log
test/dummy/tmp/
test/dummy/.sass-cache
config/initializers/secret_token.rb
25 changes: 25 additions & 0 deletions vendor/engines/employee/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
source "https://rubygems.org"

# Declare your gem's dependencies in employee.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec

# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.

# To use debugger
# gem 'debugger'

group :test do
gem 'mongoid-rspec'
end

gem 'mongoid', git: 'https://github.com/mongoid/mongoid.git'

gem 'bson'
gem 'bson_ext'


122 changes: 122 additions & 0 deletions vendor/engines/employee/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
GIT
remote: https://github.com/mongoid/mongoid.git
revision: 5b0f031992cbec66d68c6cb288a4edb952ed5336
specs:
mongoid (4.0.0.beta1)
activemodel (>= 4.0.0)
moped (~> 2.0.beta6)
origin (~> 2.1)
tzinfo (>= 0.3.37)

PATH
remote: .
specs:
employee (0.0.1)
rails (~> 4.0.2)

GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.2)
actionpack (= 4.0.2)
mail (~> 2.5.4)
actionpack (4.0.2)
activesupport (= 4.0.2)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.2)
activesupport (= 4.0.2)
builder (~> 3.1.0)
activerecord (4.0.2)
activemodel (= 4.0.2)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.2)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.2)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.2)
atomic (1.1.14)
bson (2.2.0)
bson_ext (1.5.1)
builder (3.1.4)
connection_pool (1.2.0)
diff-lcs (1.2.5)
erubis (2.7.0)
hike (1.2.3)
i18n (0.6.9)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
minitest (4.7.5)
mongoid-rspec (1.10.0)
mongoid (>= 3.0.1)
rake
rspec (>= 2.14)
moped (2.0.0.beta6)
bson (~> 2.2)
connection_pool (~> 1.2)
optionable (~> 0.2.0)
multi_json (1.8.4)
optionable (0.2.0)
origin (2.1.0)
polyglot (0.3.3)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.0.2)
actionmailer (= 4.0.2)
actionpack (= 4.0.2)
activerecord (= 4.0.2)
activesupport (= 4.0.2)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.2)
sprockets-rails (~> 2.0.0)
railties (4.0.2)
actionpack (= 4.0.2)
activesupport (= 4.0.2)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.1.1)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.7)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.5)
sprockets (2.10.1)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
thor (0.18.1)
thread_safe (0.1.3)
atomic
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.38)

PLATFORMS
ruby

DEPENDENCIES
bson
bson_ext
employee!
mongoid!
mongoid-rspec
20 changes: 20 additions & 0 deletions vendor/engines/employee/MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright 2014 YOURNAME

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions vendor/engines/employee/README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= Employee

This project rocks and uses MIT-LICENSE.
32 changes: 32 additions & 0 deletions vendor/engines/employee/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end

require 'rdoc/task'

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Employee'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end




Bundler::GemHelper.install_tasks

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end


task default: :test
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require_tree .
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Employee
class ApplicationController < ActionController::Base
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Employee
module ApplicationHelper
end
end
10 changes: 10 additions & 0 deletions vendor/engines/employee/app/models/employee/address.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Employee
class Address
include Mongoid::Document
field :address, type: String
field :city, type: String
field :pincode, type: Integer
field :state, type: String
embedded_in :Company
end
end
11 changes: 11 additions & 0 deletions vendor/engines/employee/app/models/employee/company.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Employee
class Company
include Mongoid::Document
field :name, type: String
field :logo, type: String
field :registration_date, type: Date
embeds_one :registered_address , class_name: 'Address'
embeds_one :current_address , class_name: 'Address'
has_many :roles
end
end
8 changes: 8 additions & 0 deletions vendor/engines/employee/app/models/employee/role.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Employee
class Role
include Mongoid::Document
field :description, type: String
field :level, type: Integer
belongs_to :company
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Employee</title>
<%= stylesheet_link_tag "employee/application", media: "all" %>
<%= javascript_include_tag "employee/application" %>
<%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

</body>
</html>
13 changes: 13 additions & 0 deletions vendor/engines/employee/bin/rails
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.

ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/employee/engine', __FILE__)


require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
require "mongoid"
require 'rails/engine/commands'
2 changes: 2 additions & 0 deletions vendor/engines/employee/config/routes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Employee::Engine.routes.draw do
end
Loading