crittercism 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d03ea2120220de474ede3427e2bbd72864f73ca5
4
+ data.tar.gz: a18c1ebbe0517f4aab551bbbddbd3bcb1a7ec765
5
+ SHA512:
6
+ metadata.gz: 7f79b8b10611d0550b48f064a8cc4d8c3e15ad8aca8cd7ae44823f0537a4c43fa23628a6b1a7b6d7105b169234ea1c6614d434973e63878011286c73a0c54c71
7
+ data.tar.gz: 9bbc99f4b26ed3a0764a80c9a02c0a73c2887403a947baa0d9016868965b849b4f782a1e17187cd428cb8c6dd54bb35d51473ede8af38565aa984f6d00b862db
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in crittercism.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Andrew Havens
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # Crittercism
2
+
3
+ [Crittercism](http://www.crittercism.com/) is the easiest way (that I've found)
4
+ to add crash reporting to a RubyMotion application. This gem provides an even
5
+ easier way to integrate the Crittercism SDK into your project.
6
+
7
+ Currently, this gem only supports iOS projects.
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'crittercism'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle && rake pod:install
20
+
21
+ ## Usage
22
+
23
+ 1. Register for a Crittercism account.
24
+ 2. Register your app in Crittercism.
25
+ 3. Find your `App ID` and `API Key` on the App Settings page.
26
+
27
+ In your Rakefile, specify your Crittercism App ID and API Key:
28
+
29
+ ```ruby
30
+ Motion::Project::App.setup do |app|
31
+ # ...
32
+ app.crittercism_app_id = "YOUR_APP_ID"
33
+ app.crittercism_api_key = "YOUR_API_KEY"
34
+ # ...
35
+ end
36
+ ```
37
+
38
+ Next, enable Crittercism within your `app_delegate.rb`:
39
+
40
+ ```ruby
41
+ class AppDelegate
42
+ def application(app, didFinishLaunchingWithOptions: options)
43
+ Crittercism.enableWithAppID("YOUR_APP_ID")
44
+ # ...
45
+ end
46
+ end
47
+ ```
48
+
49
+ Refer to the [Crittercism docs](http://docs.crittercism.com/ios/ios.html) for
50
+ information on how to use Crittercism's other features.
51
+
52
+ ### Rake Task
53
+
54
+ You will need to upload your app's dSYM to Crittercism for symbolication.
55
+
56
+ $ rake crittercism:upload_dsym
57
+
58
+ Typically, you will want to upload your dSYM every time you build your app.
59
+ You can configure your rake tasks to include this task.
60
+
61
+ ```ruby
62
+ task :my_custom_deploy_task => ['archive:distribution', 'crittercism:upload_dsym']
63
+ ```
64
+
65
+ <!--
66
+ ## Development
67
+
68
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
69
+
70
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
71
+ -->
72
+
73
+ ## Contributing
74
+
75
+ Bug reports and pull requests are welcome on GitHub at https://github.com/andrewhavens/crittercism.
76
+
77
+
78
+ ## License
79
+
80
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "crittercism"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "crittercism"
5
+ spec.version = "0.1.0"
6
+ spec.authors = ["Andrew Havens"]
7
+ spec.email = ["email@andrewhavens.com"]
8
+
9
+ spec.summary = %q{Crash reporting for your RubyMotion app.}
10
+ spec.homepage = "https://github.com/andrewhavens/crittercism"
11
+ spec.license = "MIT"
12
+
13
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
14
+ # spec.bindir = "exe"
15
+ # spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
16
+ spec.require_paths = ["lib"]
17
+
18
+ spec.add_runtime_dependency "motion-cocoapods"
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.10"
21
+ spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "rspec"
23
+ end
@@ -0,0 +1,18 @@
1
+ module Motion
2
+ module Project
3
+ class Config
4
+ variable :crittercism_app_id, :crittercism_api_key
5
+ end
6
+ end
7
+ end
8
+
9
+ Motion::Project::App.setup do |app|
10
+ app.pods do
11
+ pod 'CrittercismSDK', '5.3.0' # any higher conflicts with New Relic, resulting in duplicate symbol errors
12
+ end
13
+
14
+ # TODO: add runtime support for fetching configured App ID
15
+ # app.files << 'rubymotion_lib/crittercism.rb'
16
+ end
17
+
18
+ require "crittercism/rake_tasks"
@@ -0,0 +1,53 @@
1
+ namespace :crittercism do
2
+
3
+ def platform
4
+ # FIXME: need to be able to fetch this dynamically
5
+ 'iPhoneOS'
6
+ end
7
+
8
+ def app_dsym
9
+ App.config.app_bundle(platform) + '.dSYM'
10
+ end
11
+
12
+ desc 'Zip .dSYM file'
13
+ task :zip_dsym do
14
+ puts 'Zipping dSYM file...'
15
+ raise "Could not find dSYM file at #{app_dsym}" unless File.exist?(app_dsym)
16
+
17
+ app_dsym_zip = app_dsym + '.zip'
18
+ if !File.exist?(app_dsym_zip) or File.mtime(app_dsym) > File.mtime(app_dsym_zip)
19
+ Dir.chdir(File.dirname(app_dsym)) do
20
+ sh "/usr/bin/zip -q -r '#{File.basename(app_dsym)}.zip' '#{File.basename(app_dsym)}'"
21
+ end
22
+ end
23
+ end
24
+
25
+ desc 'Submit .dSYM to Crittercism'
26
+ task :upload_dsym => :zip_dsym do
27
+ require 'net/http'
28
+ require 'net/http/post/multipart'
29
+
30
+ puts 'Submitting dSYM to Crittercism...'
31
+
32
+ upload_uri = "https://api.crittercism.com/api_beta/dsym/#{App.config.crittercism_app_id}"
33
+ uri = URI.parse(upload_uri)
34
+ http = Net::HTTP.new(uri.host, uri.port)
35
+ http.use_ssl = true
36
+
37
+ request = Net::HTTP::Post::Multipart.new(uri.path,
38
+ 'dsym' => UploadIO.new("#{app_dsym}.zip", 'application/zip', 'dsym.zip'),
39
+ 'key' => App.config.crittercism_api_key
40
+ )
41
+ response = http.request(request)
42
+
43
+ puts "Crittercism Response: #{response.code} #{response.message}"
44
+ p response.body unless /^2\d+/.match("#{response.code}")
45
+
46
+ # TODO: use simple curl command once I can figure out how to display a helpful response
47
+ # curl = "/usr/bin/curl #{upload_uri} "\
48
+ # '--silent --output /dev/null '\
49
+ # "-F dsym=@'#{app_dsym}.zip' "\
50
+ # "-F key='#{App.config.crittercism_api_key}' "
51
+ # sh curl
52
+ end
53
+ end
@@ -0,0 +1,8 @@
1
+ # TODO
2
+ # class Motion::Crittercism
3
+ # APP_ID = "APPIDGOESHERE"
4
+ #
5
+ # def self.enable
6
+ # Crittercism.enableWithAppID(APP_ID)
7
+ # end
8
+ # end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: crittercism
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Havens
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: motion-cocoapods
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description:
70
+ email:
71
+ - email@andrewhavens.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".travis.yml"
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - bin/console
84
+ - bin/setup
85
+ - crittercism.gemspec
86
+ - lib/crittercism.rb
87
+ - lib/crittercism/rake_tasks.rb
88
+ - rubymotion_lib/crittercism.rb
89
+ homepage: https://github.com/andrewhavens/crittercism
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.4.5
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Crash reporting for your RubyMotion app.
113
+ test_files: []