appsendr 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -1,7 +1,6 @@
1
1
  Manifest
2
2
  README.rdoc
3
3
  Rakefile
4
- appsendr.gemspec
5
4
  bin/appsendr
6
5
  lib/appsendr.rb
7
6
  lib/appsendr/binary_plist.rb
data/README.rdoc CHANGED
@@ -1,29 +1,16 @@
1
1
  # == Synopsis
2
- # Ruby command-line app that interacts with the Apple Developer Portal, Xcode, and the AppSendr webservice
2
+ # Ruby command-line app that interacts with Xcode and the AppSendr webservice
3
3
  #
4
4
  # == Examples
5
5
  # Calling this in a Xcode project directory will build the project with an active configuration of AdHoc
6
- # appsendr
6
+ # appsendr build AdHoc
7
7
  #
8
8
  # Other examples:
9
- # appsendr -q
10
- # appsendr --verbose
9
+ # appsendr deploy AdHoc
11
10
  #
12
11
  # == Usage
13
12
  # appsendr [options]
14
13
  #
15
- # For help use: appsendr -h
16
- #
17
- # == Options
18
- # -c, --active_config Sets the active configuration for the XCode project
19
- # -u, --username Apple Developer portal username
20
- # -p, --password Apple Developer portal password
21
- # -d, --devices Path to profiles if different then devices.ad
22
- # -h, --help Displays help message
23
- # -v, --version Display the version, then exit
24
- # -q, --quiet Output as little as possible, overrides verbose
25
- # -V, --verbose Verbose output
26
- #
27
14
  #
28
15
  # == Author
29
16
  # Nolan Brown
@@ -35,16 +22,28 @@
35
22
 
36
23
  === General Commands
37
24
 
38
- help # show this usage
39
- version # show the gem version
25
+ help # show this usage
26
+ version # show the gem version
27
+
28
+ list # list your apps
29
+ link # link your app with an exsiting one in appsendr
30
+ create <name> # create a new app
31
+
32
+ url # get the latest version install url. pass --copy to copy to the clipboard
33
+
34
+ build <active configuration> # build your xcode project and deploy
35
+ build:clean # clean your xcode project
36
+
37
+ deploy <active configuration> # deploy the current build. pass --notify to send notification to all testers
40
38
 
41
- build <active configuration> # build and deploy app
42
- build:clean # clean project
39
+ testers # list testers
40
+ testers:add <email> <name> # add a tester
41
+ testers:remove <email> # remove a tester
42
+ testers:clear # remove all testers
43
+ testers:notify <group> # notify testers about the latest build. group is optional.
43
44
 
44
- testers # list testers for app
45
- testers:add <email> <name> #
46
- testers:remove <email>
47
- testers:clear
45
+ groups # list groups
48
46
 
49
- deploy <active configuration> #deploy the current build
50
- deploy:notify #notify testers about the latest build
47
+ collaborators # list collaborators
48
+ collaborators:add <email> # add collaborators
49
+ collaborators:remove <email> # add collaborators
data/appsendr.gemspec CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{appsendr}
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["AppSendr"]
9
- s.date = %q{2010-12-15}
9
+ s.date = %q{2010-12-27}
10
10
  s.default_executable = %q{appsendr}
11
11
  s.description = %q{A gem that will build and distribute an iphone/ipad app to the web for remote install}
12
12
  s.email = %q{nolanbrown@gmail.com}
13
13
  s.executables = ["appsendr"]
14
14
  s.extra_rdoc_files = ["README.rdoc", "bin/appsendr", "lib/appsendr.rb", "lib/appsendr/binary_plist.rb", "lib/appsendr/client.rb", "lib/appsendr/command.rb", "lib/appsendr/commands/app.rb", "lib/appsendr/commands/auth.rb", "lib/appsendr/commands/base.rb", "lib/appsendr/commands/build.rb", "lib/appsendr/commands/collaborators.rb", "lib/appsendr/commands/deploy.rb", "lib/appsendr/commands/help.rb", "lib/appsendr/commands/testers.rb", "lib/appsendr/commands/version.rb", "lib/appsendr/constants.rb", "lib/appsendr/helpers.rb"]
15
- s.files = ["Manifest", "README.rdoc", "Rakefile", "appsendr.gemspec", "bin/appsendr", "lib/appsendr.rb", "lib/appsendr/binary_plist.rb", "lib/appsendr/client.rb", "lib/appsendr/command.rb", "lib/appsendr/commands/app.rb", "lib/appsendr/commands/auth.rb", "lib/appsendr/commands/base.rb", "lib/appsendr/commands/build.rb", "lib/appsendr/commands/collaborators.rb", "lib/appsendr/commands/deploy.rb", "lib/appsendr/commands/help.rb", "lib/appsendr/commands/testers.rb", "lib/appsendr/commands/version.rb", "lib/appsendr/constants.rb", "lib/appsendr/helpers.rb", "terms"]
15
+ s.files = ["Manifest", "README.rdoc", "Rakefile", "bin/appsendr", "lib/appsendr.rb", "lib/appsendr/binary_plist.rb", "lib/appsendr/client.rb", "lib/appsendr/command.rb", "lib/appsendr/commands/app.rb", "lib/appsendr/commands/auth.rb", "lib/appsendr/commands/base.rb", "lib/appsendr/commands/build.rb", "lib/appsendr/commands/collaborators.rb", "lib/appsendr/commands/deploy.rb", "lib/appsendr/commands/help.rb", "lib/appsendr/commands/testers.rb", "lib/appsendr/commands/version.rb", "lib/appsendr/constants.rb", "lib/appsendr/helpers.rb", "terms", "appsendr.gemspec"]
16
16
  s.homepage = %q{http://www.appsendr.com/gem}
17
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Appsendr", "--main", "README.rdoc"]
18
18
  s.require_paths = ["lib"]
@@ -42,79 +42,84 @@ class AppSendr::Client
42
42
  end
43
43
 
44
44
  def authenticate
45
- post('/api/user/authenticate');
45
+ post('/api/user/authenticate.json');
46
46
  end
47
47
 
48
48
  def list
49
- JSON.parse(get('/api/app/list'))
49
+ get('/api/user/apps.json')
50
50
  end
51
51
 
52
52
  def link(id)
53
- post('/api/app/link',{:id=>id});
53
+ get('/api/app/show/'+id.to_s+'.json');
54
+ end
55
+ def current_version(app_id)
56
+ get('/api/app/versions/'+app_id.to_s+'.json',{:limit=>1})
54
57
  end
55
58
 
56
- def install_url(app_id)
57
- JSON.parse(get('/api/app/last_install_url/'+app_id.to_s))
59
+ def versions(app_id)
60
+ get('/api/app/versions/'+app_id.to_s+'.json')
58
61
  end
59
62
 
60
63
  def create(name)
61
- JSON.parse(post('/api/app/create', {:name=>name}))
64
+ post('/api/app/create.json', {:name=>name})
62
65
  end
63
66
 
64
67
  def add_tester(app_id,email,name,udid=nil)
65
- post('/api/app/add_tester/'+app_id.to_s,{:email=>email, :name=>name});
68
+ post('/api/tester/create.json',{:email=>email, :name=>name, :app_id=>app_id.to_s});
66
69
  end
67
70
 
68
71
  def remove_tester(app_id,email)
69
- post('/api/app/remove_tester/'+app_id.to_s,{:email=>email});
72
+ post('/api/tester/destroy.json',{:email=>email, :app_id=>app_id.to_s});
70
73
  end
71
74
 
72
75
  def clear_testers(app_id)
73
- delete('/api/app/clear_testers/'+app_id.to_s,{});
76
+ delete('/api/tester/clear.json',{:app_id=>app_id.to_s});
74
77
  end
75
78
 
76
79
  def add_group(app_id,name)
77
- post('/api/app/add_group/'+app_id.to_s,{:name=>name});
80
+ post('/api/group/create.json',{:name=>name,:app_id=>app_id.to_s});
78
81
  end
79
82
 
80
83
  def remove_group(app_id, name)
81
- post('/api/app/remove_group/'+app_id.to_s,{:name=>name});
84
+ post('/api/group/destroy.json',{:name=>name,:app_id=>app_id.to_s});
82
85
  end
83
86
 
84
87
  def groups(app_id)
85
- JSON.parse(get('/api/app/groups/'+app_id.to_s))
88
+ get('/api/app/groups/'+app_id.to_s+'.json')
86
89
  end
87
90
 
88
91
  ### add_collaborator
89
92
 
90
93
  def add_collaborator(app_id,emaill)
91
- post('/api/app/add_collaborator/'+app_id.to_s,{:email=>email});
94
+ post('/api/collaborator/create.json',{:email=>email,:app_id=>app_id.to_s});
92
95
  end
93
96
 
94
97
  def remove_collaborator(app_id,email)
95
- post('/api/app/remove_collaborator/'+app_id.to_s,{:email=>email});
98
+ post('/api/collaborator/destroy.json',{:email=>email,:app_id=>app_id.to_s});
96
99
  end
97
100
 
98
101
  def collaborators(app_id)
99
- JSON.parse(get('/api/app/collaborators/'+app_id.to_s))
102
+ get('/api/app/collaborators/'+app_id.to_s+'.json')
100
103
  end
101
104
 
102
105
  def testers(app_id)
103
- JSON.parse(get('/api/app/testers/'+app_id.to_s))
106
+ get('/api/app/testers/'+app_id.to_s+'.json')
104
107
  end
105
108
  def notify(app_id)
106
- JSON.parse(get('/api/app/notify/'+app_id.to_s))
109
+ get('/api/app/notify/'+app_id.to_s+'.json')
107
110
  end
108
111
 
109
112
  def upload(app_id, ipa,provisioning,notify, notes, bundle_id, icon)
110
113
  params = {
111
- :profile => File.new(provisioning, 'rb'),
114
+ :provisioning_profile => File.new(provisioning, 'rb'),
112
115
  :notes=>notes,
113
116
  :bundle_identifier => bundle_id,
114
117
  :built_at=>Time.now,
115
- :notify=>notify
118
+ :notify=>notify,
119
+ :app_id => app_id.to_s
116
120
  # :ipa=>
117
121
  }
122
+
118
123
  if icon
119
124
  params[:icon] = File.new(icon,'rb')
120
125
  end
@@ -123,7 +128,7 @@ class AppSendr::Client
123
128
  else
124
129
  params[:ipa] = File.new(ipa, 'rb')
125
130
 
126
- post('/api/app/upload/'+app_id.to_s, params)
131
+ post('/api/version/create/', {:version=>params})
127
132
  end
128
133
  end
129
134
 
@@ -158,12 +163,14 @@ class AppSendr::Client
158
163
 
159
164
  def get(uri,params={})
160
165
  params[:api_key] ||= @api_key
161
- RestClient.get @resource.url+uri, {:params=>params}
166
+ resp = RestClient.get @resource.url+uri, {:params=>params}
167
+ JSON.parse(resp)
162
168
  #@resource[uri].get(api_params(params))#, :content_type => 'application/json')
163
169
  end
164
170
  def post(uri,params={})
165
171
  params[:api_key] ||= @api_key
166
- @resource[uri].post(params)#, :content_type => 'application/json')
172
+ resp = @resource[uri].post(params)#, :content_type => 'application/json')
173
+ JSON.parse(resp)
167
174
  end
168
175
 
169
176
  def delete(uri,params={})
@@ -26,6 +26,8 @@ module AppSendr
26
26
  else
27
27
  error "Authentication failure"
28
28
  end
29
+ rescue RestClient::ResourceNotFound
30
+ error "Resouce not found."
29
31
  rescue RestClient::RequestFailed
30
32
  error "Something went wrong with the server."
31
33
  rescue CommandFailed => e
@@ -10,7 +10,7 @@ module AppSendr::Command
10
10
  display "=== Your apps"
11
11
  i = 0
12
12
  display list["message"].map {|app, id|
13
- "#{i+=1}. #{app['app']['name'].ljust(35)}"
13
+ "#{i+=1}. #{app['name'].ljust(35)}"
14
14
  }.join("\n")
15
15
  else
16
16
  display "You have no apps."
@@ -28,7 +28,7 @@ module AppSendr::Command
28
28
  name = args.join(" ").strip
29
29
  resp = appsendr.create(name)
30
30
  make_appsendr_dir if resp['message']
31
- @app = [resp['message']['app']['id'],resp['message']['app']['name']]
31
+ @app = [resp['message']['id'],resp['message']['name']]
32
32
  write_app
33
33
  display "Your app has been created."
34
34
 
@@ -38,10 +38,10 @@ module AppSendr::Command
38
38
  def url
39
39
  if in_project_dir?
40
40
 
41
- resp = appsendr.install_url(get_app_id)
41
+ resp = appsendr.current_version(get_app_id)
42
42
  if resp["message"].size > 0
43
43
  display "=== Your last install url is:"
44
- url = resp["message"]["install_url"]
44
+ url = resp["message"][0]['install_url']
45
45
  display url
46
46
  do_copy = option_exists?('--copy', false)
47
47
  if do_copy
@@ -66,7 +66,10 @@ module AppSendr::Command
66
66
 
67
67
  link = appsendr.link(app['id'])
68
68
  make_appsendr_dir if link
69
- @app = [app['id'],app['name']]
69
+ name = link['message']['name'] || app['name']
70
+ aid = link['message']['id'] || app['id']
71
+
72
+ @app = [aid,name]
70
73
  write_app
71
74
  display "Your app has been linked."
72
75
 
@@ -83,8 +86,8 @@ module AppSendr::Command
83
86
  display "=== Your apps"
84
87
  i = 0
85
88
  list["message"].each{|app|
86
- apps.push({"name"=>app['app']['name'], "id"=>app['app']['id']})
87
- lines.push("#{i+=1}. #{app['app']['name'].ljust(35)}")
89
+ apps.push({"name"=>app['name'], "id"=>app['id']})
90
+ lines.push("#{i+=1}. #{app['name'].ljust(35)}")
88
91
  }
89
92
  display lines.join("\n")
90
93
  print "\n"
@@ -106,7 +109,7 @@ module AppSendr::Command
106
109
  display "=== Your groups"
107
110
  i = 0
108
111
  display groups["message"].map {|app, id|
109
- "#{i+=1}. #{app['tester_group']['name'].ljust(35)}"
112
+ "#{i+=1}. #{app['name'].ljust(35)}"
110
113
  }.join("\n")
111
114
  else
112
115
  display "You have no groups."
@@ -116,6 +119,24 @@ module AppSendr::Command
116
119
  end
117
120
  end
118
121
 
122
+
123
+ def versions
124
+ if in_project_dir?
125
+
126
+ groups = appsendr.versions(get_app_id)
127
+ if groups["message"].size > 0
128
+ display "=== Your versions"
129
+ i = 0
130
+ display groups["message"].map {|app, id|
131
+ "#{i+=1}. #{app['notes']} #{app['install_url']}"
132
+ }.join("\n")
133
+ else
134
+ display "You have no version."
135
+ end
136
+ else
137
+ error("You are not in a project directory")
138
+ end
139
+ end
119
140
  # def info
120
141
  # name = (args.first && !args.first =~ /^\-\-/) ? args.first : extract_app
121
142
  # attrs = appsendr.info(name)
@@ -1,5 +1,5 @@
1
1
  module AppSendr::Command
2
- class Deploy < Build ## Inherhits from Deploy
2
+ class Collaborators < Build ## Inherhits from Deploy
3
3
 
4
4
  def index
5
5
  if in_project_dir?
@@ -13,7 +13,7 @@ module AppSendr::Command
13
13
  display "=== Your collaborators"
14
14
  i = 0
15
15
  display testers["message"].map {|app, id|
16
- "#{i+=1}. #{app['app_user']['name']} - #{app['app_user']['email']}"
16
+ "#{i+=1}. #{app['name']} - #{app['email']}"
17
17
  }.join("\n")
18
18
  else
19
19
  display "You have no collaborators."
@@ -12,7 +12,7 @@ module AppSendr::Command
12
12
  display "=== Your testers"
13
13
  i = 0
14
14
  display testers["message"].map {|app, id|
15
- "#{i+=1}. #{app['tester']['name']} - #{app['tester']['email']}"
15
+ "#{i+=1}. #{app['name']} - #{app['email']}"
16
16
  }.join("\n")
17
17
  else
18
18
  display "You have no testers."
@@ -39,8 +39,15 @@ module AppSendr::Command
39
39
  name = args.join(" ").strip
40
40
  f.puts "#{email},#{name}"
41
41
  f.close
42
-
43
- appsendr.add_tester(read_app_id,email,name)
42
+ begin
43
+ response = appsendr.add_tester(read_app_id,email,name)
44
+ rescue RestClient::RequestFailed => e
45
+ display "=== Errors"
46
+ response = JSON.parse(e.http_body)
47
+ response['message'].each{|err|
48
+ display err.join(" ")
49
+ }
50
+ end
44
51
 
45
52
  end
46
53
  end
@@ -1,5 +1,5 @@
1
1
  module AppSendr
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  PROJECT_DIR = ".appsendr"
4
4
  APPDROPPR_DIR = ".appsendr"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsendr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - AppSendr
@@ -15,8 +15,8 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-15 00:00:00 -08:00
19
- default_executable: appsendr
18
+ date: 2010-12-27 00:00:00 -08:00
19
+ default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rest-client
@@ -106,7 +106,6 @@ files:
106
106
  - Manifest
107
107
  - README.rdoc
108
108
  - Rakefile
109
- - appsendr.gemspec
110
109
  - bin/appsendr
111
110
  - lib/appsendr.rb
112
111
  - lib/appsendr/binary_plist.rb
@@ -124,6 +123,7 @@ files:
124
123
  - lib/appsendr/constants.rb
125
124
  - lib/appsendr/helpers.rb
126
125
  - terms
126
+ - appsendr.gemspec
127
127
  has_rdoc: true
128
128
  homepage: http://www.appsendr.com/gem
129
129
  licenses: []