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
6c3249cb
Commit
6c3249cb
authored
May 21, 2017
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not need to include WeatherModuel manual, fix module define problem
parent
26461930
Hide 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 @
6c3249cb
require
'factory_girl_rails'
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
::
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
Dir
[
File
.
dirname
(
__FILE__
)
+
'/weather-model/*.rb'
].
each
{
|
file
|
require
file
}
module
WeatherModel
def
self
.
set_ohm
redis
Ohm
.
redis
=
redis
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