Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weather-model
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
weather-model
Commits
81bfe2ad
Commit
81bfe2ad
authored
May 21, 2017
by
liyijie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'liyijie/module_define' into 'master'
Do not need to include WeatherModuel manual, fix module define problem See merge request
!7
parents
26461930
6c3249cb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
weather-model.rb
lib/weather-model.rb
+9
-11
No files found.
lib/weather-model.rb
View file @
81bfe2ad
require
'factory_girl_rails'
require
'weather-model/version'
require
'weather-model/version'
module
WeatherModel
Dir
[
File
.
dirname
(
__FILE__
)
+
'/weather-model/*.rb'
].
each
{
|
file
|
require
file
}
require
'factory_girl_rails'
def
self
.
included
base
Dir
[
File
.
dirname
(
__FILE__
)
+
'/weather-model/*.rb'
].
each
{
|
file
|
require
file
}
::
WeatherModel
::
SourceSchema
.
sorts
.
each
{
|
sort
|
::
WeatherModel
.
const_set
(
sort
,
Module
.
new
)}
::
WeatherModel
::
SourceSchema
.
constants
.
each
do
|
source
|
settings
=
::
WeatherModel
::
SourceSchema
.
const_get
(
source
)
::
WeatherModel
.
const_get
(
settings
[
:sort
]).
const_set
(
source
,
Class
.
new
(
Storer
::
Mysql
)).
use_settings
(
settings
)
end
end
module
WeatherModel
def
self
.
set_ohm
redis
def
self
.
set_ohm
redis
Ohm
.
redis
=
redis
Ohm
.
redis
=
redis
end
end
end
end
WeatherModel
::
SourceSchema
.
sorts
.
each
{
|
sort
|
WeatherModel
.
const_set
(
sort
,
Module
.
new
)}
WeatherModel
::
SourceSchema
.
constants
.
each
do
|
source
|
settings
=
WeatherModel
::
SourceSchema
.
const_get
(
source
)
WeatherModel
.
const_get
(
settings
[
:sort
]).
const_set
(
source
,
Class
.
new
(
WeatherModel
::
Storer
::
Mysql
)).
use_settings
(
settings
)
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment