ish_manager 0.1.8.53 → 0.1.8.54

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c5635ac768418267102d40a8a8310ce6054757e
4
- data.tar.gz: 63075c95fcf7f377f67012d6f7ffbea3ffeee558
3
+ metadata.gz: 57350f9fa6579dc906316bc7939fc961c98103d0
4
+ data.tar.gz: 92a1842c9e2e659de2eb9aac6aa75f673b91c83e
5
5
  SHA512:
6
- metadata.gz: 93b66baf48810fcce33b040d65733bdaffaa45e9ea0087a3f05d08db3776b4c54fdd73a8875c0b3487cd7786255d7486c3a1925c4cd2f8b92d3070481984d6c6
7
- data.tar.gz: 4ce63769241cae185482b5c02de045db03069a4a7fcd0c9cb10f6225691983d48ce0a99771b8fa4003efa4bef77914df4dccbf26ffc9f8fd8716b1bbb392f68c
6
+ metadata.gz: c0b22706f05e3f6509769e9058158d088a9193bbd7c956e17d627183b48ee26c095bc8233bfec39a5c07de2eb7848d0dc3c001b7a769ef3a52cc3c4126ab6add
7
+ data.tar.gz: 3cc3e1458b1869b33e3ec8631f73a0e94d0839e2de7c4ab99c39c1a8107518e8237aebb5bf3df31ca24be00bb2d40ee1df35e1058e2cf51b05e534003a7a6fa8
data/README.md CHANGED
@@ -2,3 +2,4 @@
2
2
  # Test
3
3
 
4
4
  cd test/dummy && be rspec spec/controllers
5
+
@@ -15,7 +15,6 @@
15
15
  //= require ish_manager/jquery.iframe-transport
16
16
  //= require ish_manager/jquery.ui.widget
17
17
  //= require ish_manager/jquery.fileupload
18
- //= require ish_manager/materialize.js
19
18
  //
20
19
 
21
20
  $(function () {
@@ -11,7 +11,6 @@
11
11
  * It is generally better to create a new file per style scope.
12
12
  *
13
13
  *= require ish_manager/bootstrap
14
- *= require ish_manager/materialize
15
14
  *= require_self
16
15
  */
17
16
 
@@ -69,6 +68,10 @@ hr {
69
68
  .clearfix {
70
69
  clear: both;
71
70
  }
71
+ .blue {
72
+ background: #5bc0de;
73
+ color: white;
74
+ }
72
75
 
73
76
  .manager--main-header {
74
77
  background: url('/assets/bg/weather.png');
@@ -112,3 +115,19 @@ nav.pagination
112
115
  ul.tags ul.tags {
113
116
  margin-left: 2em;
114
117
  }
118
+
119
+ /**
120
+ * ally
121
+ */
122
+ .price {
123
+ /* margin-left: 1em; */
124
+ }
125
+ .descriptive {
126
+ line-height: 2em;
127
+ }
128
+ .price::before {
129
+ content: "$";
130
+ position: absolute;
131
+ top: 1em;
132
+ left: 0;
133
+ }
@@ -0,0 +1,12 @@
1
+
2
+ class IshManager::AllyController < IshManager::ApplicationController
3
+
4
+ def home
5
+ authorize! :home_ally, IshManager::Ability
6
+ render 'home', :layout => 'ish_manager/application_no_materialize'
7
+ end
8
+
9
+ end
10
+
11
+
12
+
@@ -2,5 +2,16 @@ module IshManager
2
2
  class ApplicationMailer < ActionMailer::Base
3
3
  default from: 'from@example.com'
4
4
  layout 'mailer'
5
+
6
+ def welcome
7
+ @var = :value
8
+ mail( :to => 'piousbox@gmail.com', :subject => 'Abba, welcome!' ).deliver
9
+ end
10
+
11
+ def stock_alert stock
12
+ @stock = stock
13
+ mail( :to => 'piousbox@gmail.com', :subject => 'IshManager Stock Alert' ).deliver
14
+ end
15
+
5
16
  end
6
17
  end
@@ -0,0 +1,19 @@
1
+
2
+ %h1 Ally / Home
3
+
4
+ = form_tag nil, :class => 'form-inline well' do
5
+ .form-group
6
+ %select
7
+ %option{ :value => "Email Me" } Email Me
8
+ %option{ :value => "Do Nothing" } Do Nothing
9
+ .form-group
10
+ %label.control-label When
11
+ = text_field_tag :ticker, 'NFLX', :class => 'form-control'
12
+ .form-group
13
+ %label.control-label Price
14
+ = select_tag :direction, options_for_select([ ['rises above', nil], ['falls below', nil] ])
15
+ .form-group
16
+ %label.control-label $
17
+ = number_field_tag :price, 99.99
18
+ .form-group
19
+ = button_tag ">", :class => %w(btn blue)
@@ -5,15 +5,15 @@
5
5
  .col-sm-12
6
6
  %br
7
7
  %ul.nav.nav-pills
8
- %li= link_to 'Cities', cities_path
9
- %li= link_to 'Events', events_path
10
- %li= link_to 'Galleries', galleries_path
11
- %li= link_to 'Profiles', user_profiles_path
12
- %li= link_to 'Reports', reports_path
13
- %li= link_to 'Sites', sites_path
14
- %li= link_to 'Tags', tags_path
15
- %li= link_to 'Venues', venues_path
16
- %li= link_to 'Videos', videos_path
17
- %li= link_to 'Users', user_profiles_path
8
+ %li{ :class => params[:controller] == 'ish_manager/cities' ? 'active' : '' }= link_to 'Cities', cities_path
9
+ %li{ :class => params[:controller] == 'ish_manager/events' ? 'active' : '' }= link_to 'Events', events_path
10
+ %li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }= link_to 'Galleries', galleries_path
11
+ %li{ :class => params[:controller] == 'ish_manager/user_profiles' ? 'active' : '' }= link_to 'Profiles', user_profiles_path
12
+ %li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }= link_to 'Reports', reports_path
13
+ %li{ :class => params[:controller] == 'ish_manager/sites' ? 'active' : '' }= link_to 'Sites', sites_path
14
+ %li{ :class => params[:controller] == 'ish_manager/tags' ? 'active' : '' }= link_to 'Tags', tags_path
15
+ %li{ :class => params[:controller] == 'ish_manager/venues' ? 'active' : '' }= link_to 'Venues', venues_path
16
+ %li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }= link_to 'Videos', videos_path
17
+ %li{ :class => params[:controller] == 'ish_manager/ally' ? 'active' : '' }= link_to 'Ally', ally_root_path
18
18
  %hr
19
19
 
@@ -0,0 +1,8 @@
1
+ <html>
2
+ <head>
3
+ </head>
4
+ <body>
5
+ <h5>Notice</h5>
6
+ <p>The stock <b><%= @stock.ticker %></b> is trading <%= @stock.direction %> <%= @stock.price %> at <%= Time.now %>.</p>
7
+ </body>
8
+ </html>
@@ -0,0 +1,7 @@
1
+ <html>
2
+ <head>
3
+ </head>
4
+ <body>
5
+ <h1>Hello, here is your key: <%= @key %>.</h1>
6
+ </body>
7
+ </html>
@@ -1,18 +1,19 @@
1
1
  !!!
2
2
  %html
3
3
  %head
4
- %title Ish manager
4
+ %title Ish Manager
5
5
  %link{ :rel => 'icon', :href => '/favicon.ico?v=1' }
6
6
  %meta{ :name => :viewport, :content => 'width=device-width, initial-scale=1.0' }
7
7
  %meta{ :charset => 'UTF-8' }
8
8
  %meta{ :description => 'some description' }
9
- -# %script{ :src => "https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js" }
10
9
  %script{ :src => "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" }
11
10
  %script{ :src => "https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.6.3/jquery.tinymce.min.js" }
12
11
  %script{ :src => "https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.6.3/tinymce.min.js" }
13
12
  = stylesheet_link_tag "ish_manager/application", media: "all"
13
+ = stylesheet_link_tag "ish_manager/materialize", media: "all"
14
14
  = stylesheet_link_tag "//fonts.googleapis.com/icon?family=Material+Icons"
15
15
  = javascript_include_tag "ish_manager/application"
16
+ = javascript_include_tag "ish_manager/materialize"
16
17
  = csrf_meta_tags
17
18
  %body
18
19
  .bg-white
@@ -0,0 +1,28 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title Ish Manager
5
+ %link{ :rel => 'icon', :href => '/favicon.ico?v=1' }
6
+ %meta{ :name => :viewport, :content => 'width=device-width, initial-scale=1.0' }
7
+ %meta{ :charset => 'UTF-8' }
8
+ %meta{ :description => 'some description' }
9
+ %script{ :src => "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" }
10
+ %script{ :src => "https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.6.3/jquery.tinymce.min.js" }
11
+ %script{ :src => "https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.6.3/tinymce.min.js" }
12
+ = stylesheet_link_tag "ish_manager/application", media: "all"
13
+ = stylesheet_link_tag "//fonts.googleapis.com/icon?family=Material+Icons"
14
+ = javascript_include_tag "ish_manager/application"
15
+ = csrf_meta_tags
16
+ %body
17
+ .bg-white
18
+ = render :partial => 'ish_manager/application/main_header'
19
+ .container
20
+ .row
21
+ .col-sm-12
22
+ - if notice
23
+ %p.notice= notice
24
+ - if alert
25
+ %p.alert= alert
26
+ .container
27
+ = yield
28
+ = render :partial => 'ish_manager/application/main_footer'
data/config/routes.rb CHANGED
@@ -1,6 +1,10 @@
1
1
  IshManager::Engine.routes.draw do
2
2
  root :to => 'application#home'
3
3
 
4
+ scope :ally, :as => 'ally' do
5
+ root :to => 'ally#home'
6
+ end
7
+
4
8
  resources :cities do
5
9
  resources :features
6
10
  resources :newsitems
@@ -10,7 +10,8 @@ module IshManager
10
10
  =end
11
11
 
12
12
  initializer "ish_manager.assets.precompile" do |app|
13
- app.config.assets.precompile += %w( ish_manager/application.js ish_manager/application.css )
13
+ app.config.assets.precompile << %w( ish_manager/application.js ish_manager/application.css )
14
+ app.config.assets.precompile << %w( ish_manager/materialize.js ish_manager/materialize.css )
14
15
  end
15
16
  end
16
17
  end
@@ -1,5 +1,10 @@
1
1
 
2
- namespace :ish do
2
+ def puts! a, b=''
3
+ puts "+++ +++ #{b}"
4
+ puts a.inspect
5
+ end
6
+
7
+ namespace :ish_manager do
3
8
 
4
9
  desc "every user needs a user_profile"
5
10
  task :generate_user_profiles => :environment do
@@ -13,4 +18,28 @@ namespace :ish do
13
18
  puts 'OK'
14
19
  end
15
20
 
21
+ desc 'watch the stocks'
22
+ task :watch_stocks => :environment do
23
+ stocks = IshModels::StockWatch.where( :notification_type => :EMAIL )
24
+ while true
25
+ print '.'
26
+ stocks.each do |stock|
27
+ begin
28
+ Timeout::timeout( 10 ) do
29
+ r = HTTParty.get "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=#{stock.ticker}&interval=1min&apikey=X1C5GGH5MZSXMF3O"
30
+ r = JSON.parse( r.body )['Time Series (1min)']
31
+ r = r[r.keys.first]['4. close'].to_f
32
+ if stock.direction == :ABOVE && r >= stock.price ||
33
+ stock.direction == :BELOW && r <= stock.price
34
+ IshManager::ApplicationMailer.stock_alert( stock ).deliver
35
+ end
36
+ end
37
+ rescue Exception => e
38
+ puts! e, 'e in :watch_stocks'
39
+ end
40
+ end
41
+ sleep 60
42
+ end
43
+ end
44
+
16
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.53
4
+ version: 0.1.8.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-20 00:00:00.000000000 Z
11
+ date: 2017-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -138,6 +138,7 @@ files:
138
138
  - app/assets/stylesheets/ish_manager/materialize.css
139
139
  - app/assets/stylesheets/ish_manager/trash/bootstrap.min.css
140
140
  - app/assets/stylesheets/ish_manager/trash/bootstrap.min.css.map
141
+ - app/controllers/ish_manager/ally_controller.rb
141
142
  - app/controllers/ish_manager/application_controller.rb
142
143
  - app/controllers/ish_manager/cities_controller.rb
143
144
  - app/controllers/ish_manager/features_controller.rb
@@ -161,6 +162,7 @@ files:
161
162
  - app/models/ish_manager/ability.rb
162
163
  - app/models/ish_manager/ability.rb~
163
164
  - app/models/ish_manager/application_record.rb
165
+ - app/views/ish_manager/ally/home.haml
164
166
  - app/views/ish_manager/application/_form_errors.haml
165
167
  - app/views/ish_manager/application/_main_footer.haml
166
168
  - app/views/ish_manager/application/_main_header.haml
@@ -168,6 +170,8 @@ files:
168
170
  - app/views/ish_manager/application/_meta.haml
169
171
  - app/views/ish_manager/application/_meta.haml~
170
172
  - app/views/ish_manager/application/home.haml
173
+ - app/views/ish_manager/application_mailer/stock_alert.html.erb
174
+ - app/views/ish_manager/application_mailer/welcome.html.erb
171
175
  - app/views/ish_manager/cities/_form.haml
172
176
  - app/views/ish_manager/cities/_header.haml
173
177
  - app/views/ish_manager/cities/edit.haml
@@ -297,6 +301,7 @@ files:
297
301
  - app/views/ish_manager/videos/show.haml
298
302
  - app/views/layouts/ish_manager/application.haml
299
303
  - app/views/layouts/ish_manager/application.haml~
304
+ - app/views/layouts/ish_manager/application_no_materialize.haml
300
305
  - config/mongoid.yml
301
306
  - config/routes.rb
302
307
  - lib/ish_manager.rb