ayadn 2.1 → 3.0

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: 9f91b217c6c170cfcc4cb0bfb47be2b881463054
4
- data.tar.gz: cdc82c5ddcda7512c6195be5abc219e28935c17b
3
+ metadata.gz: 669aa931c86f3c1503fcb018d9ae061c4807f821
4
+ data.tar.gz: 9e0b95916d303a4f163a751db01533a6cc95ba5f
5
5
  SHA512:
6
- metadata.gz: 1e59fafb75249a6a9bc64be41c434ef0a4311ab7f0181011c5c4283dcb2abcb27d36bab6d985bb00a7d0d219d1172287186f0e4c5d317eea577c029d58591352
7
- data.tar.gz: d6919bab279e3b739ac73a6c2259859eb9bc774b8fa4329debaf04eb209119645864c27fb51ff23bae0ca6976b64e7643a802b07de9a99639bbf3a33ef555ff6
6
+ metadata.gz: 94b1ffcc7e1ef7c8350b02da3e56f28e0164a2b13ef63ecf2ece988c36fd70ebec9edf690b6aef921707da2ef385e9fbebe7bad0667ababde8656d9d1dd6297c
7
+ data.tar.gz: 4ce0e8e000c1306678ebaddcc5d2a6dcae772e8cb3bdc3c866d9679d93920b8f5dbf48896899022e5c38a5c6d821509095c5f684a6964b78a23dde3a37e77a1a
data/.gitignore CHANGED
@@ -14,7 +14,7 @@ lib/bundler/man
14
14
  pkg
15
15
  rdoc
16
16
  spec/reports
17
- spec/mock/ayadn.log
17
+ spec/mock/*.log*
18
18
  test/tmp
19
19
  test/version_tmp
20
20
  tmp
@@ -22,3 +22,4 @@ token
22
22
  fake.db
23
23
  .ruby-version
24
24
  *.zip
25
+ .gitignore
@@ -2,9 +2,8 @@ language: ruby
2
2
  cache: bundler
3
3
 
4
4
  rvm:
5
+ - "2.2.3"
5
6
  - "2.2.0"
6
- - "2.1.2"
7
- - "2.1.1"
8
7
  - "2.1.0"
9
8
  - "2.0.0"
10
9
 
@@ -1,3 +1,14 @@
1
+ ## 3.0 - 2015-11-07 - 'Edge Of Tomorrow'
2
+
3
+ - New: option to set an alternative base URL for the API calls
4
+ - New: run diagnostics (network, accounts, settings, gem)
5
+ - New: --auth bypass authorization webpage by providing the token inline
6
+ - New: edit settings with your $EDITOR
7
+ - Fixed: commands when no user authorized
8
+ - Fixed: --unauthorize if no valid username
9
+ - Deprecated: Ayadn 1.x migration tools
10
+ - Deprecated: "ayadn-app.net" domain name (use GitHub repository)
11
+
1
12
  ## 2.1 - 2015-08-29 - 'Electric Boogaloo'
2
13
 
3
14
  - Fix: crash when scrolling Global with NiceRank
data/README.md CHANGED
@@ -62,25 +62,23 @@ Uninstall:
62
62
 
63
63
  `gem uninstall ayadn`
64
64
 
65
- # DOCUMENTATION
65
+ ## DOCUMENTATION
66
66
 
67
67
  [In the /doc folder of the repo](https://github.com/ericdke/na/tree/master/doc)
68
68
 
69
- # CONTACT
69
+ ## FEEDBACK
70
+
71
+ Feedback and/or contributions are very welcomed!
72
+
73
+ ## CONTACT
70
74
 
71
75
  Author: [@ericd](http://app.net/ericd)
72
76
 
73
77
  App account: [@ayadn](http://app.net/ayadn)
74
78
 
75
- Website: [ayadn-app.net](http://ayadn-app.net)
76
-
77
79
  ADN Directory: [Ayadn](https://directory.app.net/app/345/ayadn/)
78
80
 
79
- # FEEDBACK
80
-
81
- Feedback and/or contributions are very welcomed!
82
-
83
- # SCREENSHOTS
81
+ ## SCREENSHOTS
84
82
 
85
83
  Examples on Mac OS X, with iTerm2 + Solarized theme.
86
84
 
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = "eric@aya.io"
11
11
  spec.summary = %q{App.net command-line client.}
12
12
  spec.description = %q{App.net command-line client: toolbox to access and manage your ADN data, show your streams, post, manage conversations, star/follow/repost... and many, many more.}
13
- spec.homepage = "http://ayadn-app.net"
13
+ spec.homepage = "https://github.com/ericdke/na"
14
14
  spec.license = "MIT"
15
15
  spec.metadata = { "documentation" => "https://github.com/ericdke/na/tree/master/doc" }
16
16
 
@@ -26,7 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency "rest-client", "~> 1.7"
27
27
  spec.add_dependency "rainbow", "~> 2.0"
28
28
  spec.add_dependency "terminal-table", "~> 1.4"
29
- spec.add_dependency "daybreak", "~> 0.3"
30
29
  spec.add_dependency "pinboard", "~> 0.1"
31
30
  spec.add_dependency "unicode_utils", "~> 1.4"
32
31
  spec.add_dependency "spotlite", "~> 0.8"
@@ -26,10 +26,20 @@ Ayadn also works on Windows because it's pure Ruby, but some Gems it depends upo
26
26
 
27
27
  ## MIGRATE
28
28
 
29
+ ### From Ayadn 2.x to 3.x
30
+
31
+ There's nothing to do, just update the Gem.
32
+
33
+ ### From Ayadn 1.x to 2.x
34
+
29
35
  If you have an old Ayadn 1.x install that you want to keep using with Ayadn 2.x, Ayadn 2.x will ask you to run the `migrate` command (once) for this account.
30
36
 
31
37
  Otherwise it's better to start with a fresh configuration: just delete your old 1.0 `~/ayadn` folder before authorizing the user again with Ayadn 2.x.
32
38
 
39
+ ### From Ayadn 1.x to 3.x
40
+
41
+ Ayadn 3.x is not compatible at all with Ayadn 1.x. Delete your `~/ayadn` folder before authorizing the user again with Ayadn 3.x.
42
+
33
43
  ## DEPENDENCIES
34
44
 
35
45
  Ayadn depends upon these Gems:
@@ -46,4 +56,4 @@ Ayadn depends upon these Gems:
46
56
  unicode_utils (text utilities)
47
57
  daybreak (Ruby data store)
48
58
 
49
- *Note: the "daybreak" dependency is only needed for 1.x to 2.x migrations. As this migration is optional and Ayadn 1.x is deprecated, this dependency will be removed in future versions.*
59
+ *Note: the "daybreak" dependency is only needed for 1.x to 2.x migrations. Deprecated since Ayadn 3.0.*
@@ -6,8 +6,6 @@
6
6
 
7
7
  [@ayadn](http://app.net/ayadn)
8
8
 
9
- [ayadn-app.net](http://ayadn-app.net)
10
-
11
9
  ## THANK YOU
12
10
 
13
11
  This is a list of people who helped me developing Ayadn by giving me awesome feedback and support.
@@ -2,7 +2,7 @@
2
2
 
3
3
  begin
4
4
  require_relative 'ayadn/version'
5
- %w{rest_client json thor rainbow/ext/string terminal-table yaml logger fileutils io/console unicode_utils readline amalgalite fast_cache}.each { |r| require "#{r}" }
5
+ %w{rest_client json thor rainbow/ext/string terminal-table yaml logger fileutils io/console unicode_utils readline amalgalite}.each { |r| require "#{r}" }
6
6
  Rainbow.enabled = true
7
7
  require_relative 'ayadn/app'
8
8
  rescue LoadError => e
@@ -6,11 +6,12 @@ module Ayadn
6
6
  # This class is the main initializer + dispatcher
7
7
  # It responds to the CLI commands dispatcher, app.rb
8
8
 
9
+ require_relative "stream"
10
+
9
11
  def initialize
10
12
  @api = API.new
11
13
  @view = View.new
12
14
  @workers = Workers.new
13
- @thor = Thor::Shell::Color.new
14
15
  @status = Status.new
15
16
  @check = Check.new
16
17
  Settings.load_config
@@ -466,13 +467,19 @@ module Ayadn
466
467
  response = details.call
467
468
  @check.no_post(response, post_id)
468
469
  resp = response['data']
470
+
471
+ if resp["is_deleted"] == true
472
+ @status.user_404(resp["id"])
473
+ Errors.global_error({error: "user 404", caller: caller, data: [post_id, options]})
474
+ end
475
+
469
476
  response = @api.get_user("@#{resp['user']['username']}")
470
477
  @check.no_user(response, response['data']['username'])
471
478
  stream = response['data']
472
479
  @status.post_info
473
480
  @view.show_simple_post([resp], options)
474
481
  puts "\n" if Settings.options[:timeline][:compact] == true
475
- @thor.say_status "info", "author", "cyan"
482
+ @status.say_info "author"
476
483
  puts "\n" unless Settings.options[:timeline][:compact] == true
477
484
  if response['data']['username'] == Settings.config[:identity][:username]
478
485
  @view.show_userinfos(stream, @api.get_token_info['data'], true)
@@ -556,7 +563,7 @@ module Ayadn
556
563
  Settings.options[:marker][:messages] = false
557
564
  end
558
565
  puts "\n"
559
- @thor.say_status :searching, "channels with unread PMs"
566
+ @status.say_nocolor :searching, "channels with unread PMs"
560
567
  response = @api.get_channels
561
568
  unread_channels = []
562
569
  response['data'].map do |ch|
@@ -570,7 +577,7 @@ module Ayadn
570
577
  end
571
578
  unread_messages = {}
572
579
  unread_channels.reverse.each do |id|
573
- @thor.say_status :downloading, "messages from channel #{id}"
580
+ @status.say_nocolor :downloading, "messages from channel #{id}"
574
581
  since = Databases.find_last_id_from("channel:#{id}")
575
582
  unless since.nil?
576
583
  api_options = {count: 20, since_id: since}
@@ -593,9 +600,9 @@ module Ayadn
593
600
  resp = @api.update_marker(name, v[1])
594
601
  res = JSON.parse(resp)
595
602
  if res['meta']['code'] != 200
596
- @thor.say_status :error, "couldn't update channel #{k} as read", :red
603
+ @status.say_error "couldn't update channel #{k} as read"
597
604
  else
598
- @thor.say_status :updated, "channel #{k} as read", :green
605
+ @status.say_green :updated, "channel #{k} as read"
599
606
  end
600
607
  end
601
608
  end
@@ -895,14 +902,6 @@ module Ayadn
895
902
  end
896
903
  end
897
904
 
898
- def version
899
- begin
900
- @status.version
901
- rescue => e
902
- Errors.global_error({error: e, caller: caller, data: []})
903
- end
904
- end
905
-
906
905
  private
907
906
 
908
907
  def save_and_view(resp)
@@ -36,7 +36,7 @@ module Ayadn
36
36
  {
37
37
  "type" => "com.ayadn.client",
38
38
  "value" => {
39
- "url" => "http://ayadn-app.net",
39
+ "url" => "https://github.com/ericdke/na",
40
40
  "author" => {
41
41
  "name" => "Eric Dejonckheere",
42
42
  "username" => "ericd",
@@ -36,9 +36,14 @@ module Ayadn
36
36
  end
37
37
 
38
38
  def get_explore(explore, options)
39
- url = Endpoints.new.trending(options) if explore == :trending
40
- url = Endpoints.new.photos(options) if explore == :photos
41
- url = Endpoints.new.conversations(options) if explore == :conversations
39
+ url = case explore
40
+ when :trending
41
+ Endpoints.new.trending(options)
42
+ when :photos
43
+ Endpoints.new.photos(options)
44
+ when :conversations
45
+ Endpoints.new.conversations(options)
46
+ end
42
47
  get_parsed_response(url)
43
48
  end
44
49
 
@@ -4,7 +4,7 @@ module Ayadn
4
4
  package_name "Ayadn"
5
5
 
6
6
  begin
7
- %w{action stream api search descriptions endpoints cnx view workers settings post status extend databases fileops logs pinboard set alias errors blacklist scroll authorize switch mark nicerank debug check nowplaying nowwatching tvshow annotations profile migration}.each { |r| require_relative "#{r}" }
7
+ %w{action api descriptions endpoints cnx view workers settings post status extend databases fileops logs set alias errors blacklist mark nicerank debug check diagnostics}.each { |r| require_relative "#{r}" }
8
8
  rescue Interrupt
9
9
  puts "\nExit: stopped by user while launching\n\n"
10
10
  exit
@@ -254,6 +254,7 @@ module Ayadn
254
254
  option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force
255
255
  option :compact, aliases: "-k", type: :boolean, desc: "Force the view to be compact if not already"
256
256
  def hashtag(hashtag)
257
+ require_relative("search")
257
258
  Action.new.hashtag(hashtag, options)
258
259
  end
259
260
 
@@ -271,6 +272,7 @@ module Ayadn
271
272
  option :channels, type: :boolean, desc: 'Search for App.net channels by searching WORD(S) in their description.'
272
273
  option :annotations, type: :boolean, desc: 'Search for posts containing a specific App.net annotation.'
273
274
  def search(*words)
275
+ require_relative("search")
274
276
  Action.new.search(words.join(","), options)
275
277
  end
276
278
 
@@ -304,6 +306,7 @@ module Ayadn
304
306
  option :avatar, type: :array, desc: "Update your avatar picture"
305
307
  option :cover, type: :array, desc: "Update your cover picture"
306
308
  def userupdate
309
+ require_relative("profile")
307
310
  Action.new.userupdate(options)
308
311
  end
309
312
 
@@ -455,6 +458,7 @@ module Ayadn
455
458
  long_desc Descriptions.pin
456
459
  option :force, aliases: "-f", type: :boolean, desc: Descriptions.options_force
457
460
  def pin(post_id, *tags)
461
+ require_relative("pinboard")
458
462
  Action.new.pin(post_id, tags, options)
459
463
  end
460
464
 
@@ -566,6 +570,7 @@ module Ayadn
566
570
  option :text, aliases: "-t", type: :array, desc: "Add custom text"
567
571
  option :compact, aliases: "-k", type: :boolean, desc: "Force the view to be compact if not already (after posting)"
568
572
  def nowplaying
573
+ require_relative("nowplaying")
569
574
  Action.new.nowplaying(options)
570
575
  end
571
576
 
@@ -577,6 +582,7 @@ module Ayadn
577
582
  option :alt, aliases: "-a", type: :boolean, desc: "Select an alternative response if the first didn't match"
578
583
  option :compact, aliases: "-k", type: :boolean, desc: "Force the view to be compact if not already (after posting)"
579
584
  def movie(*title)
585
+ require_relative("nowwatching")
580
586
  Action.new.nowwatching(title, options)
581
587
  end
582
588
 
@@ -587,6 +593,7 @@ module Ayadn
587
593
  option :banner, aliases: "-b", type: :boolean, desc: "Inserts the show banner instead of the show poster"
588
594
  option :compact, aliases: "-k", type: :boolean, desc: "Force the view to be compact if not already (after posting)"
589
595
  def tvshow(*title)
596
+ require_relative("tvshow")
590
597
  Action.new.tvshow(title, options)
591
598
  end
592
599
 
@@ -602,9 +609,13 @@ module Ayadn
602
609
  desc "authorize", "Authorize Ayadn (-AU)"
603
610
  map "-auth" => :authorize
604
611
  map "-AU" => :authorize
612
+ option :api, aliases: "-a", type: :array, desc: "Provide an alternative root URL for the API call."
613
+ option :token, aliases: "-t", type: :array, desc: "Provide the token directly (bypass the webpage)"
605
614
  long_desc Descriptions.authorize
606
- def authorize
607
- Authorize.new.authorize
615
+ def authorize()
616
+ require_relative("authorize")
617
+ require_relative("switch")
618
+ Authorize.new.authorize(options)
608
619
  end
609
620
 
610
621
  desc "unauthorize @USERNAME", "Unauthorize an Ayadn user account (-UA)"
@@ -613,6 +624,8 @@ module Ayadn
613
624
  option :delete, aliases: "-D", type: :boolean, desc: "Deletes user folders (default: false)"
614
625
  long_desc Descriptions.unauthorize
615
626
  def unauthorize(*user)
627
+ require_relative("authorize")
628
+ require_relative("switch")
616
629
  Authorize.new.unauthorize(user, options)
617
630
  end
618
631
 
@@ -622,6 +635,7 @@ module Ayadn
622
635
  option :list, aliases: "-l", type: :boolean, desc: "List authorized accounts"
623
636
  long_desc Descriptions.switch
624
637
  def switch(*username)
638
+ require_relative("switch")
625
639
  unless options[:list]
626
640
  Switch.new.switch(username)
627
641
  else
@@ -632,16 +646,14 @@ module Ayadn
632
646
  desc "version", "Show the current Ayadn version (-v)"
633
647
  map "-v" => :version
634
648
  def version
635
- Action.new.version
649
+ Status.new.version
636
650
  end
637
651
 
638
- desc "migrate", "Migrate databases (upgrade accounts)", :hide => true
639
- map "upgrade" => :migrate
640
- long_desc Descriptions.migrate
641
- def migrate
642
- mig = Migration.new
643
- mig.all
644
- end
652
+ desc "diagnostics", "Run diagnostics (-dg)"
653
+ map "-dg" => :diagnostics
654
+ map "check" => :diagnostics
655
+ map "test" => :diagnostics
656
+ subcommand "diagnostics", Diagnostics
645
657
 
646
658
  end
647
659
  end
@@ -5,68 +5,88 @@ module Ayadn
5
5
  def initialize
6
6
  @thor = Thor::Shell::Color.new # local statuses
7
7
  @status = Status.new # global statuses + utils
8
+ @baseURL = "https://api.app.net" # may be overriden
8
9
  end
9
10
 
10
- def authorize
11
+ def authorize(options)
11
12
  puts "\n"
12
13
  if File.exist?(Dir.home + "/ayadn/accounts.db")
13
- @status.has_to_migrate
14
+ @status.deprecated_ayadn
14
15
  exit
15
16
  end
17
+ api_file = Dir.home + "/ayadn/.api.yml"
18
+ # overrides the default value
19
+ if File.exist?(api_file)
20
+ @baseURL = YAML.load(File.read(api_file))[:root]
21
+ end
22
+ # overrides the config file
23
+ if options["api"]
24
+ @baseURL = options["api"]
25
+ end
16
26
  puts "\e[H\e[2J"
17
27
  show_link
18
- token = get_token
28
+ token = if options["token"]
29
+ options["token"][0]
30
+ else
31
+ get_token
32
+ end
33
+ # token = get_token
19
34
  check_token(token)
20
35
  puts "\e[H\e[2J"
21
- @thor.say_status :connexion, "downloading user info", :yellow
36
+ @status.say_yellow :connexion, "downloading user info"
22
37
  user = create_user_data(token, Dir.home + "/ayadn")
23
38
  prepare(user)
24
- @thor.say_status :create, "configuration", :yellow
39
+ @status.say_yellow :create, "configuration"
25
40
  Settings.load_config
26
41
  Logs.create_logger
27
42
  install
28
- @thor.say_status :done, "user #{user.handle} is authorized", :green
43
+ @status.say_green :done, "user #{user.handle} is authorized"
29
44
  Errors.info "#{user.handle} authorized."
30
- @status.say { @thor.say_status :end, "Thank you for using Ayadn. Enjoy!", :green }
45
+ @status.say { @status.say_green :end, "Thank you for using Ayadn. Enjoy!" }
31
46
  Switch.new.list
32
47
  end
33
48
 
34
49
  def unauthorize(user, options)
35
50
  begin
36
51
  @workers = Workers.new
37
- if user.size > 1
52
+ if user.size != 1
38
53
  @status.one_username
39
54
  exit
40
55
  end
41
56
  user = @workers.remove_arobase_if_present(user)[0]
42
57
  puts "\e[H\e[2J"
43
58
  if options[:delete]
44
- sure = @thor.yes?("Are you sure you want to unauthorize user @#{user} and delete its folders?\n\n> ", :red)
59
+ sure = @thor.yes?("Are you sure you want to unauthorize user @#{user} and delete its folders? [y/N]\n\n> ", :red)
45
60
  else
46
- sure = @thor.yes?("Are you sure you want to unauthorize user @#{user} ?\n\n> ", :red)
61
+ sure = @thor.yes?("Are you sure you want to unauthorize user @#{user} ? [y/N]\n\n> ", :red)
47
62
  end
48
63
  unless sure == true
49
64
  Status.new.canceled
50
65
  exit
51
66
  end
52
67
  puts "\e[H\e[2J"
53
- @thor.say_status :delete, "database entry for @#{user}", :yellow
68
+ @status.say_yellow :delete, "database entry for @#{user}"
69
+
54
70
  db = Amalgalite::Database.new(Dir.home + "/ayadn/accounts.sqlite")
71
+
55
72
  Databases.remove_from_accounts(db, user)
56
73
  if options[:delete]
57
- @thor.say_status :delete, "@#{user} user folders", :yellow
74
+ @status.say_yellow :delete, "@#{user} user folders"
58
75
  FileUtils.remove_dir(Dir.home + "/ayadn/#{user}")
59
76
  end
60
- @thor.say_status :done, "user @#{user} has been unauthorized", :green
77
+ @status.say_green :done, "user @#{user} has been unauthorized"
61
78
  remaining = Databases.all_accounts(db)
62
79
  if remaining.flatten.empty?
63
- @thor.say_status :info, "accounts database is now empty", :cyan
80
+ @status.say_info "accounts database is now empty"
64
81
  else
65
82
  username = remaining[0][0]
66
83
  Databases.set_active_account(db, username)
67
- @thor.say_status :info, "user @#{username} is now the active user", :cyan
84
+ @status.say_info "user @#{username} is now the active user"
68
85
  end
69
86
  puts "\n"
87
+ rescue Amalgalite::SQLite3::Error => e
88
+ @status.not_authorized
89
+ exit
70
90
  rescue Interrupt
71
91
  Status.new.canceled
72
92
  exit
@@ -76,11 +96,11 @@ module Ayadn
76
96
  private
77
97
 
78
98
  def prepare(user)
79
- @thor.say_status :create, "user folders", :yellow
99
+ @status.say_yellow :create, "user folders"
80
100
  create_config_folders(user)
81
- @thor.say_status :save, "user token", :yellow
101
+ @status.say_yellow :save, "user token"
82
102
  create_token_file(user)
83
- @thor.say_status :create, "Ayadn account", :yellow
103
+ @status.say_yellow :create, "Ayadn account"
84
104
  acc_db = Amalgalite::Database.new(Dir.home + "/ayadn/accounts.sqlite")
85
105
  user_db = Amalgalite::Database.new("#{user.user_path}/db/ayadn.sqlite")
86
106
  if user_db.schema.tables.empty?
@@ -93,7 +113,7 @@ module Ayadn
93
113
  end
94
114
 
95
115
  def install
96
- @thor.say_status :create, "api and config files", :yellow
116
+ @status.say_yellow :create, "api and config files"
97
117
  Errors.info "Creating api and config files..."
98
118
  Errors.info "Creating version file..."
99
119
  Settings.init_config
@@ -111,7 +131,7 @@ module Ayadn
111
131
  end
112
132
  rescue => e
113
133
  @status.say do
114
- @thor.say_status :error, "can't create #{user.handle} account folders", :red
134
+ @status.say_error "can't create #{user.handle} account folders"
115
135
  end
116
136
  @status.say { puts "\nError: #{e}" }
117
137
  exit
@@ -120,23 +140,23 @@ module Ayadn
120
140
 
121
141
  def show_link
122
142
  @status.say do
123
- @thor.say_status :please, "click or copy/paste this URL in a browser", :yellow
143
+ @status.say_yellow :please, "click or copy/paste this URL in a browser"
124
144
  puts "\n"
125
145
  puts "\t#{Endpoints.new.authorize_url}"
126
146
  puts "\n"
127
- @thor.say_status :next, "log in to authorize Ayadn", :cyan
128
- @thor.say_status nil, "you will be redirected to your 'user token'"
129
- @thor.say_status :please, "copy/paste the token here:", :yellow
147
+ @status.say_cyan :next, "log in to authorize Ayadn"
148
+ @status.say_center "you will be redirected to your 'user token'"
149
+ @status.say_yellow :please, "copy/paste the token here:"
130
150
  end
131
151
  print "\t> "
132
152
  end
133
153
 
134
154
  def get_user(token)
135
155
  begin
136
- JSON.parse(RestClient.get("https://api.app.net/users/me?access_token=#{token}", :verify_ssl => OpenSSL::SSL::VERIFY_NONE) {|response, request, result| response })
156
+ JSON.parse(RestClient.get("#{@baseURL}/users/me?access_token=#{token}", :verify_ssl => OpenSSL::SSL::VERIFY_NONE) {|response, request, result| response })
137
157
  rescue Exception => e
138
158
  @status.say do
139
- @thor.say_status :error, "connection problem", :red
159
+ @status.say_error "connection problem"
140
160
  end
141
161
  puts "#{e}"
142
162
  end
@@ -154,7 +174,7 @@ module Ayadn
154
174
  def check_token(token)
155
175
  if token.empty? || token.nil?
156
176
  @status.say do
157
- @thor.say_status :error, "couldn't get the token", :red
177
+ @status.say_error "couldn't get the token"
158
178
  end
159
179
  exit
160
180
  end