ish_manager 0.1.8.258 → 0.1.8.259

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
  SHA256:
3
- metadata.gz: e880865158238e4e853e2ff014bcdf33d2f7a34c090d340e1444215c1445b204
4
- data.tar.gz: c52428e4febc8b285e8eecdeed98734f1dc40da6fb28eb8c98f43a7f507fada0
3
+ metadata.gz: e84b6d8ddc9f84cbccd94ef5f4568311e677cb5aec5b54a40a34718174ac461c
4
+ data.tar.gz: 62f8798a0498c1adce3416cc14d533d06d94939c74848877059a8a1fc6a658c5
5
5
  SHA512:
6
- metadata.gz: 10819c852f56a077077691f454b7894ceff83a6bfc0e0e7b6838fe9c86480b4a19e901f9513249f543c353ea87828591a4739b276eebdb80e3766f68d89b141d
7
- data.tar.gz: e13e3aeedddfee4f4c798ef1350aa11a8f25d61c035bd923e1aa72f5c9a9cd332db63150f4b624ea3e786b891c75207eb72644d718d3d2af7615b3d02ef3b9d8
6
+ metadata.gz: '09cfbdc1c8603a09aa7a102188baa02ef84b0fceeb9ce9eef9b25564bc7a88f97307181a2b09a3dfaf2c5a4047f6a0951c52b4e2e9eafce74f87899feda87f6a'
7
+ data.tar.gz: 2af7d47b1690c2d759a809ff32bc7c4b66d6191ad72f226606413b02ea8058ec000715444714f573ef29436cf115b4b85bba3016699d5576af422b31913c4542
@@ -4420,6 +4420,7 @@ nav .input-field label.active i {
4420
4420
  }
4421
4421
  }
4422
4422
 
4423
+ /*
4423
4424
  @font-face {
4424
4425
  font-family: "Roboto";
4425
4426
  src: local(Roboto Thin), url("../fonts/roboto/Roboto-Thin.woff2") format("woff2"), url("../fonts/roboto/Roboto-Thin.woff") format("woff");
@@ -4449,6 +4450,7 @@ nav .input-field label.active i {
4449
4450
  src: local(Roboto Bold), url("../fonts/roboto/Roboto-Bold.woff2") format("woff2"), url("../fonts/roboto/Roboto-Bold.woff") format("woff");
4450
4451
  font-weight: 700;
4451
4452
  }
4453
+ */
4452
4454
 
4453
4455
  a {
4454
4456
  text-decoration: none;
@@ -33,7 +33,7 @@ module IshManager
33
33
  @reports_list = Report.all.list
34
34
  @sites_list = Site.all.list
35
35
  @tags_list = Tag.list
36
- @user_profiles_list = IshModels::UserProfile.all.list
36
+ @user_profiles_list = Ish::UserProfile.all.list
37
37
  @venues_list = Venue.all.list
38
38
  @videos_list = Video.all.list
39
39
  end
@@ -54,7 +54,7 @@ class IshManager::CitiesController < IshManager::ApplicationController
54
54
  @city.profile_photo = photo
55
55
  end
56
56
  if @city.save
57
- ::IshModels::CacheKey.one.update_attributes( :cities => Time.now, :feature_cities => Time.now )
57
+ ::Ish::CacheKey.one.update_attributes( :cities => Time.now, :feature_cities => Time.now )
58
58
  flash[:notice] = 'Success'
59
59
  redirect_to city_path @city.id
60
60
  else
@@ -1,15 +1,15 @@
1
1
  class IshManager::FriendsController < IshManager::ApplicationController
2
2
 
3
3
  def index
4
- authorize! :friends_index, IshModels::UserProfile
5
- @new_friend = IshModels::UserProfile.new
4
+ authorize! :friends_index, Ish::UserProfile
5
+ @new_friend = Ish::UserProfile.new
6
6
 
7
7
  @friends = current_user.profile.friends
8
8
  friend_ids = @friends.map &:id
9
9
  end
10
10
 
11
11
  def create
12
- @friend = ::IshModels::UserProfile.find_by( :email => params[:friend][:email] ) # .includes( :shared_galleries )
12
+ @friend = ::Ish::UserProfile.find_by( :email => params[:friend][:email] ) # .includes( :shared_galleries )
13
13
 
14
14
  authorize! :friends_new, @friend
15
15
 
@@ -7,7 +7,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
7
7
  def create
8
8
  params[:gallery][:shared_profiles] ||= []
9
9
  params[:gallery][:shared_profiles].delete('')
10
- params[:gallery][:shared_profiles] = IshModels::UserProfile.find params[:gallery][:shared_profiles]
10
+ params[:gallery][:shared_profiles] = Ish::UserProfile.find params[:gallery][:shared_profiles]
11
11
  @gallery = Gallery.new params[:gallery].permit!
12
12
  @gallery.user_profile = current_user.profile
13
13
  @gallery.username = current_user.profile.username
@@ -103,7 +103,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
103
103
  params[:gallery].delete :shared_profiles
104
104
 
105
105
  if @gallery.update_attributes( params[:gallery].permit! )
106
- new_shared_profiles = IshModels::UserProfile.find( params[:gallery][:shared_profile_ids]
106
+ new_shared_profiles = Ish::UserProfile.find( params[:gallery][:shared_profile_ids]
107
107
  ).select { |p| !old_shared_profile_ids.include?( p.id ) }
108
108
  ::IshManager::ApplicationMailer.shared_galleries( new_shared_profiles, @gallery ).deliver
109
109
  flash[:notice] = 'Success.'
@@ -2,26 +2,7 @@
2
2
  class IshManager::MapsController < IshManager::ApplicationController
3
3
 
4
4
  before_action :set_map, only: [:destroy, :edit, :map_editor, :show, :update, ]
5
-
6
- def index
7
- authorize! :index, ::Gameui::Map
8
- @maps = ::Gameui::Map.where( parent_slug: "" ).order( slug: :asc )
9
- @all_maps = Gameui::Map.all.order( slug: :asc )
10
- end
11
-
12
- def show
13
- authorize! :show, @map
14
- @maps = Gameui::Map.where( parent_slug: @map.slug )
15
- end
16
-
17
- def new
18
- authorize! :new, ::Gameui::Map
19
- @map = ::Gameui::Map.new
20
- end
21
-
22
- def edit
23
- authorize! :edit, @map
24
- end
5
+ before_action :set_lists
25
6
 
26
7
  def create
27
8
  @map = ::Gameui::Map.new(map_params)
@@ -46,6 +27,39 @@ class IshManager::MapsController < IshManager::ApplicationController
46
27
  end
47
28
  end
48
29
 
30
+ def destroy
31
+ authorize! :destroy, @map
32
+ @map.destroy
33
+ respond_to do |format|
34
+ format.html { redirect_to maps_path, notice: 'Map was successfully destroyed.' }
35
+ end
36
+ end
37
+
38
+ def edit
39
+ authorize! :edit, @map
40
+ end
41
+
42
+ def index
43
+ authorize! :index, ::Gameui::Map
44
+ @maps = ::Gameui::Map.unscoped.where( parent_slug: "" ).order( slug: :asc )
45
+ @all_maps = Gameui::Map.all.order( slug: :asc )
46
+ end
47
+
48
+ def map_editor
49
+ authorize! :update, @map
50
+ @markers = @map.markers.unscoped
51
+ end
52
+
53
+ def new
54
+ authorize! :new, ::Gameui::Map
55
+ @map = ::Gameui::Map.new
56
+ end
57
+
58
+ def show
59
+ authorize! :show, @map
60
+ @maps = Gameui::Map.where( parent_slug: @map.slug )
61
+ end
62
+
49
63
  def update
50
64
  authorize! :update, @map
51
65
 
@@ -70,27 +84,22 @@ class IshManager::MapsController < IshManager::ApplicationController
70
84
  end
71
85
  end
72
86
 
73
- def destroy
74
- authorize! :destroy, @map
75
- @map.destroy
76
- respond_to do |format|
77
- format.html { redirect_to maps_path, notice: 'Map was successfully destroyed.' }
78
- end
79
- end
80
-
81
- def map_editor
82
- authorize! :update, @map
83
- end
84
-
85
87
  private
86
88
 
87
- def set_map
88
- @map = ::Gameui::Map.where(id: params[:id]).first
89
- @map ||= Gameui::Map.find_by(slug: params[:id])
90
- end
89
+ def map_params
90
+ out = params.require(:gameui_map).permit!
91
91
 
92
- def map_params
93
- params.require(:gameui_map).permit!
92
+ out[:shared_profiles].delete('')
93
+ if out[:shared_profiles].present?
94
+ out[:shared_profiles] = Ish::UserProfile.find( out[:shared_profiles] )
94
95
  end
95
96
 
97
+ out
98
+ end
99
+
100
+ def set_map
101
+ @map = ::Gameui::Map.unscoped.where(id: params[:id]).first
102
+ @map ||= Gameui::Map.unscoped.find_by(slug: params[:id])
103
+ end
104
+
96
105
  end
@@ -3,6 +3,7 @@ class IshManager::MarkersController < IshManager::ApplicationController
3
3
 
4
4
  before_action :set_map, except: [ :destroy, :edit, :update ]
5
5
  before_action :set_marker, only: [ :edit, :update ]
6
+ before_action :set_lists
6
7
 
7
8
  def new
8
9
  authorize! :new_marker, ::Gameui::Map
@@ -78,12 +79,19 @@ class IshManager::MarkersController < IshManager::ApplicationController
78
79
  end
79
80
 
80
81
  def set_marker
81
- @marker = ::Gameui::Marker.find params[:id]
82
+ @marker = ::Gameui::Marker.unscoped.find params[:id]
82
83
  @map = @marker.map
83
84
  end
84
85
 
85
86
  def marker_params
86
- params.require(:gameui_marker).permit!
87
+ out = params.require(:gameui_marker).permit!
88
+
89
+ out[:shared_profiles].delete('')
90
+ if out[:shared_profiles].present?
91
+ out[:shared_profiles] = Ish::UserProfile.find( out[:shared_profiles] )
92
+ end
93
+
94
+ out
87
95
  end
88
96
 
89
97
  end
@@ -11,7 +11,7 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
11
11
  @resource ||= Site.find params[:newsitem][:site_id] if !params[:newsitem][:site_id].blank?
12
12
  @resource ||= Tag.find params[:tag_id] if params[:tag_id]
13
13
  @resource ||= Tag.find params[:newsitem][:tag_id] if !params[:newsitem][:tag_id].blank?
14
- @resource ||= IshModels::UserProfile.find params[:newsitem][:user_profile_id] if !params[:newsitem][:user_profile_id].blank?
14
+ @resource ||= Ish::UserProfile.find params[:newsitem][:user_profile_id] if !params[:newsitem][:user_profile_id].blank?
15
15
  @resource ||= ::Gameui::Map.find params[:newsitem][:map_id] if !params[:newsitem][:map_id].blank?
16
16
  @resource.newsitems << @newsitem
17
17
  @resource.touch
@@ -26,7 +26,7 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
26
26
  url = case @resource.class.name
27
27
  when "City"
28
28
  edit_city_path( @resource.id )
29
- when "IshModels::UserProfile"
29
+ when "Ish::UserProfile"
30
30
  user_profiles_path
31
31
  when "Site"
32
32
  edit_site_path( @resource.id )
@@ -3,7 +3,7 @@ class IshManager::StockWatchesController < IshManager::ApplicationController
3
3
 
4
4
  def index
5
5
  authorize! :index, Ish::StockWatch
6
- @profiles = IshModels::UserProfile.all
6
+ @profiles = Ish::UserProfile.all
7
7
  @stock_watches = Ish::StockWatch.order_by( ticker: :asc, direction: :asc, price: :desc
8
8
  ).includes( :profile )
9
9
  @stock_watch = Ish::StockWatch.new
@@ -4,22 +4,22 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
4
4
  before_action :set_lists
5
5
 
6
6
  def index
7
- @user_profiles = IshModels::UserProfile.all.includes( :user )
8
- authorize! :index, IshModels::UserProfile
7
+ @user_profiles = Ish::UserProfile.all.includes( :user )
8
+ authorize! :index, Ish::UserProfile
9
9
  end
10
10
 
11
11
  def show
12
- @user_profile = IshModels::UserProfile.find params[:id]
12
+ @user_profile = Ish::UserProfile.find params[:id]
13
13
  authorize! :show, @user_profile
14
14
  end
15
15
 
16
16
  def edit
17
- @profile = IshModels::UserProfile.find params[:id]
17
+ @profile = Ish::UserProfile.find params[:id]
18
18
  authorize! :edit, @profile
19
19
  end
20
20
 
21
21
  def update
22
- @profile = IshModels::UserProfile.find params[:id]
22
+ @profile = Ish::UserProfile.find params[:id]
23
23
  authorize! :update, @profile
24
24
 
25
25
  if params[:photo]
@@ -42,14 +42,14 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
42
42
  end
43
43
 
44
44
  def new
45
- @profile = IshModels::UserProfile.new
45
+ @profile = Ish::UserProfile.new
46
46
  authorize! :new, @profile
47
47
  end
48
48
 
49
49
  def create
50
50
  @user = User.find_or_create_by( :email => params[:profile][:email] )
51
51
  @user.password ||= (0...12).map { rand(100) }.join
52
- @user.profile = IshModels::UserProfile.new params[:profile].permit!
52
+ @user.profile = Ish::UserProfile.new params[:profile].permit!
53
53
  authorize! :create, @user.profile
54
54
 
55
55
  if params[:photo]
@@ -87,7 +87,7 @@ class IshManager::VideosController < IshManager::ApplicationController
87
87
 
88
88
  def edit
89
89
  @video = Video.unscoped.find params[:id]
90
- @user_profiles_list = IshModels::UserProfile.list
90
+ @user_profiles_list = Ish::UserProfile.list
91
91
  authorize! :edit, @video
92
92
 
93
93
  @tags_list = Tag.unscoped.or( { :is_public => true }, { :user_id => current_user.id } ).list
@@ -28,7 +28,7 @@ class IshManager::Ability
28
28
  can [ :manage ], ::CoTailors
29
29
 
30
30
  can [ :new ], ::Feature
31
- can [ :friends_index, :friends_new ], ::IshModels::UserProfile
31
+ can [ :friends_index, :friends_new ], ::Ish::UserProfile
32
32
 
33
33
  can [ :index, :new, :create, :create_photo ], ::Gallery
34
34
  can [ :edit, :update ], ::Gallery do |g|
@@ -47,7 +47,7 @@ class IshManager::Ability
47
47
  can [ :new, :show, :edit, :update, :create_newsitem, :new_feature, :create_feature, :newsitems_index ], ::Site do |site|
48
48
  !site.is_private && !site.is_trash
49
49
  end
50
- can [ :manage ], Ish::StockWatch
50
+ can [ :manage ], ::Warbler::StockWatch
51
51
 
52
52
  can [ :index, :new, :create ], ::Tag
53
53
 
@@ -0,0 +1,16 @@
1
+
2
+ .application--form-nonpublic
3
+ .panel
4
+ .panel-body
5
+ .row
6
+ .col.s3
7
+ = f.check_box :is_public
8
+ = f.label :is_public
9
+ .col.s4
10
+ = f.label 'Shared with'
11
+ = f.select :shared_profiles, options_for_select(@user_profiles_list, selected: model.shared_profile_ids), {}, { :multiple => true }
12
+ .col.s4
13
+ Shared with:<br />
14
+ - model.shared_profiles.each do |p|
15
+ &gt; #{p.email} <br />
16
+ .col.s4 &nbsp;
@@ -4,7 +4,9 @@
4
4
  %i.fa.fa-compress.collapse-expand#collapseHeader
5
5
  .content
6
6
  %ul
7
- %li{ :class => params[:controller] == 'ish_manager/maps' ? 'active' : '' }= link_to 'GameUi::Maps', maps_path
7
+ %li{ :class => params[:controller] == 'ish_manager/maps' ? 'active' : '' }
8
+ = link_to 'GameUi::Maps', maps_path
9
+ = link_to '[+]', new_map_path
8
10
  %li{ :class => params[:controller] == 'ish_manager/cities' ? 'active' : '' }= link_to 'Cities', cities_path
9
11
  %li{ :class => params[:controller] == 'ish_manager/events' ? 'active' : '' }= link_to 'Events', events_path
10
12
  %li{ :class => params[:controller] == 'ish_manager/venues' ? 'active' : '' }= link_to 'Venues', venues_path
@@ -14,9 +16,15 @@
14
16
  %ul
15
17
  %li{ class: params[:controller] == 'ish_manager/newsitems' ? 'active' : '' }= link_to '+Newsitem', new_newsitem_path
16
18
  %li{ :class => params[:controller] == 'ish_manager/sites' ? 'active' : '' }= link_to 'Sites', sites_path
17
- %li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }= link_to 'Galleries', galleries_path
18
- %li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }= link_to 'Reports', reports_path
19
- %li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }= link_to 'Videos', videos_path
19
+ %li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }
20
+ = link_to 'Galleries', galleries_path
21
+ = link_to '[+]', new_gallery_path
22
+ %li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }
23
+ = link_to 'Reports', reports_path
24
+ = link_to '[+]', new_report_path
25
+ %li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }
26
+ = link_to 'Videos', videos_path
27
+ = link_to '[+]', new_video_path
20
28
  %li{ :class => params[:controller] == 'ish_manager/tags' ? 'active' : '' }= link_to 'Tags', tags_path
21
29
 
22
30
  - proc do # nothing
@@ -29,18 +29,9 @@
29
29
  = f.label :tags
30
30
  = f.select :tag_ids, @tags_list, {}, { multiple: true }
31
31
 
32
- .row
33
- .panel
34
- .panel-body
35
- .col.s4
36
- = f.label 'Shared with'
37
- = f.select :shared_profiles, options_for_select( [[nil,nil,:disabled=>true]]+current_user.profile.friends.map { |f| [ f.email, f.id ] }, :selected => gallery.shared_profiles.map(&:id) ), {}, { :multiple => true }
38
- .col.s4
39
- Shared with:<br />
40
- - gallery.shared_profiles.each do |p|
41
- &gt; #{p.email} <br />
42
- .col.s4
43
- "/
32
+ = render 'ish_manager/application/form_nonpublic', f: f, model: gallery
33
+
34
+
44
35
  .row
45
36
  = f.label :subhead
46
37
  = f.text_area :subhead
@@ -48,9 +39,6 @@
48
39
  = f.text_area :descr, class: :tinymce
49
40
 
50
41
  .row
51
- .col.s3
52
- = f.check_box :is_public
53
- = f.label :is_public
54
42
  .col.s3
55
43
  = f.check_box :is_trash
56
44
  = f.label :is_trash
@@ -30,14 +30,21 @@
30
30
  .col.s2
31
31
  .field
32
32
  = f.label :ordering_type
33
- = f.select :ordering_type, options_for_select(::Gameui::Map::ORDERING_TYPES)
33
+ = f.select :ordering_type, options_for_select(::Gameui::Map::ORDERING_TYPES, selected: @map.ordering_type)
34
+ .field
35
+ = f.label :rated
36
+ = f.select :rated, options_for_select(Location::RATED_OPTIONS, selected: @map.rated)
37
+ .field
38
+ = f.label :premium_tier
39
+ = f.number_field :premium_tier
34
40
  .col.s4
35
-
36
41
  .field
37
42
  = f.label :image
38
43
  = file_field_tag :image
39
44
  = image_tag @map.image.image.url(:thumb) rescue nil
40
45
 
46
+ = render 'ish_manager/application/form_nonpublic', f: f, model: @map
47
+
41
48
  .field
42
49
  = f.label :description
43
50
  = f.text_area :description, class: 'tinymce'
@@ -4,16 +4,16 @@
4
4
 
5
5
  .map-editor
6
6
  = image_tag @map.image.image.url(:original)
7
- - @map.markers.each do |m|
7
+ - @markers.each do |m|
8
8
  .marker{ data: { 'slug': m.slug, 'center-offset-x': m.centerOffsetX, 'center-offset-y': m.centerOffsetY }, style: "top: #{m.y-m.centerOffsetY}px; left: #{m.x-m.centerOffsetX}px;" }
9
9
  = image_tag m.image.image.url(:original)
10
10
  = image_tag('icons/10x10_red-cross.png', class: 'red-cross', style: "top: #{m.centerOffsetY-10}px; left: #{m.centerOffsetX-10}px;" )
11
11
 
12
12
  .markers-list
13
13
  %h1
14
- Markers (#{@map.markers.length})
14
+ Markers (#{@markers.length})
15
15
  = link_to '[+]', new_marker_path({ map_id: @map.id })
16
- - @map.markers.each do |m|
16
+ - @markers.each do |m|
17
17
  = form_for m, { html: { class: "item #{m.slug}" }, url: marker_path(m.id) } do |f|
18
18
  = m.slug
19
19
  = link_to '[~]', edit_marker_path(m.id)
@@ -57,6 +57,8 @@
57
57
  = file_field_tag :title_image
58
58
  = image_tag @marker.title_image.image.url(:thumb) rescue nil
59
59
 
60
+ = render 'ish_manager/application/form_nonpublic', f: f, model: @marker
61
+
60
62
  .field
61
63
  = f.label :url, "URL (if any)"
62
64
  = f.text_field :url
@@ -24,7 +24,7 @@
24
24
  %br
25
25
 
26
26
  .input-field
27
- = f.select :role_name, options_for_select( [[nil, nil]] + IshModels::UserProfile::ROLES.map { |r| [ r, r ] }, :selected => profile.role_name )
27
+ = f.select :role_name, options_for_select( [[nil, nil]] + Ish::UserProfile::ROLES.map { |r| [ r, r ] }, :selected => profile.role_name )
28
28
  %label role name
29
29
 
30
30
  .input-field
@@ -23,7 +23,6 @@
23
23
  %li
24
24
  <b>Profile Photo:</b>
25
25
  = image_tag profile.profile_photo.photo.url(:thumb) rescue nil
26
- %li <b>Address:</b> #{profile.addresses[0].inspect}
27
26
 
28
27
  .col.s8
29
28
  %h5 Shared galleries
@@ -8,7 +8,8 @@
8
8
  %ul
9
9
  - @user_profile.premium_purchases.each do |purchase|
10
10
  %li
11
- -# = purchase.item_type.constantize.find(purchase.item_id).inspect
12
- = render 'ish_manager/reports/show_mini', report: purchase.item_type.constantize.find(purchase.item_id)
11
+ = purchase.item_type.constantize.find(purchase.item_id).inspect
12
+ -## this doesn't work b/c an unlocked map has no city.
13
+ -# = render 'ish_manager/reports/show_mini', report: purchase.item_type.constantize.find(purchase.item_id)
13
14
 
14
15
 
@@ -10,7 +10,7 @@ namespace :ish_manager do
10
10
  task :generate_user_profiles => :environment do
11
11
  User.all.map do |u|
12
12
  unless u.profile
13
- p = ::IshModels::UserProfile.new :email => u.email, :user => u, :role_name => :guy
13
+ p = ::Ish::UserProfile.new :email => u.email, :user => u, :role_name => :guy
14
14
  u.profile = p
15
15
  u.save && p.save && print('.')
16
16
  end
@@ -18,38 +18,6 @@ namespace :ish_manager do
18
18
  puts 'OK'
19
19
  end
20
20
 
21
- =begin
22
- desc 'watch the stocks, and trigger actions'
23
- task :watch_stocks => :environment do
24
- while true
25
- stocks = Ish::StockWatch.where( :notification_type => :EMAIL )
26
- puts! stocks.map(&:ticker), "Watching these stocks on #{Time.now}"
27
- stocks.each do |stock|
28
- begin
29
- Timeout::timeout( 10 ) do
30
- r = HTTParty.get "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=#{stock.ticker}&interval=1min&apikey=X1C5GGH5MZSXMF3O"
31
- end
32
- rescue Exception => e
33
- puts! e, 'e in :watch_stocks'
34
- end
35
- r = JSON.parse( r.body )['Time Series (1min)']
36
- r = r[r.keys.first]['4. close'].to_f
37
- if stock.direction == :ABOVE && r >= stock.price ||
38
- stock.direction == :BELOW && r <= stock.price
39
- IshManager::ApplicationMailer.stock_alert( stock ).deliver
40
-
41
- ## actions
42
- # stock.stock_actions.where( :is_active => true ).each do |action|
43
- # # @TODO: actions
44
- # end
45
-
46
- end
47
- end
48
- sleep 60
49
- end
50
- end
51
- =end
52
-
53
21
  desc 'watch the stocks, and trigger actions - not alphavantage, tda now. 2021-08-08'
54
22
  task watch_stocks: :environment do
55
23
  while true
@@ -82,16 +50,4 @@ namespace :ish_manager do
82
50
  end
83
51
  end
84
52
 
85
- =begin
86
- desc 'yahoo-watch the stocks'
87
- task :stockwatcher => :environment do
88
- watcher = YahooStockwatcher.new
89
- while true
90
- watcher.watch_once
91
- print '.'
92
- sleep 60 # seconds
93
- end
94
- end
95
- =end
96
-
97
53
  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.258
4
+ version: 0.1.8.259
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-05 00:00:00.000000000 Z
11
+ date: 2021-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -226,6 +226,7 @@ files:
226
226
  - app/views/ish_manager/application/_analytics.html
227
227
  - app/views/ish_manager/application/_debug.haml
228
228
  - app/views/ish_manager/application/_form_errors.haml
229
+ - app/views/ish_manager/application/_form_nonpublic.haml
229
230
  - app/views/ish_manager/application/_main_footer.haml
230
231
  - app/views/ish_manager/application/_main_header.haml
231
232
  - app/views/ish_manager/application/_main_header_admin.haml