sourceninja 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +21 -13
- data/lib/sourceninja/sourceninja.rb +13 -1
- data/lib/sourceninja/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
Note
|
2
2
|
----
|
3
3
|
* This gem is currently alpha. __You need to be invited to [SourceNinja Alpha](http://www.sourceninja.com/sign-up.html) in order to use this gem__.
|
4
|
-
* If you are using Heroku, please refer to the [Heroku Documentation](heroku-addon) and please ignore this documentation.
|
5
4
|
|
6
5
|
What is SourceNinja
|
7
6
|
-------------------
|
@@ -10,24 +9,31 @@ SourceNinja is an awesome service that allows you to stay informed of updates to
|
|
10
9
|
Visit [SourceNinja](http://sourceninja.com) to learn more.
|
11
10
|
|
12
11
|
What is the sourceninja gem
|
13
|
-
|
12
|
+
---------------------------
|
14
13
|
The sourceninja gem is a gem that can be included in your rails application to allow seamless integration with SourceNinja. The sourceninja gem will send all of your gem files and versions to SourceNinja to begin managing your open source libraries.
|
15
14
|
|
16
15
|
Getting Started
|
17
16
|
---------------
|
18
|
-
|
19
|
-
|
20
|
-
gem 'sourceninja'
|
17
|
+
1. Create a [SourceNinja](http://sourceninja.com) account. Currently, you need to be part of our [alpha](http://www.sourceninja.com/sign-up.html).
|
21
18
|
|
22
|
-
|
23
|
-
|
24
|
-
bundle install
|
19
|
+
2. Log into SourceNinja and create a product. The product you create will be paired with your application.
|
25
20
|
|
26
|
-
|
21
|
+
3. After you create a product, you will be directed to a page asking what language your application is running. Select `Rails` from the menu on the left side.
|
27
22
|
|
28
|
-
|
23
|
+
4. You will be presented with two values, you'll need these two values later.
|
24
|
+
```
|
25
|
+
SOURCENINJA_TOKEN="50a336d92da8ddea1ae0a6c0d06a172"
|
26
|
+
SOURCENINJA_PRODUCT_ID="477fcfa7-765a-4b91-b6a5-2ebe4c4f9d58"
|
27
|
+
```
|
29
28
|
|
30
|
-
|
29
|
+
5. Install the [sourceninja gem](http://github.com/SourceNinja/sourceninja-ruby). You can do this by adding the following line to your Gemfile.
|
30
|
+
```
|
31
|
+
gem "sourceninja", "~> 0.0.6"
|
32
|
+
```
|
33
|
+
|
34
|
+
6. Run `bundle install`.
|
35
|
+
|
36
|
+
7. Set the environment variables ```SOURCENINJA_TOKEN``` and ```SOURCENINJA_PRODUCT_ID``` using the values from step 4.
|
31
37
|
|
32
38
|
Updated Magically in Production
|
33
39
|
-----------------
|
@@ -43,10 +49,12 @@ If you would like to test sourceninja gem locally, you will want to create an in
|
|
43
49
|
ENV["SOURCENINJA_TOKEN"] ||= "1cea0be98caf02e830ac2aadbe44e4ee"
|
44
50
|
ENV["SOURCENINJA_PRODUCT_ID"] ||= "fb89e064-b48c-d0c3-81x4-a34a5b60a654"
|
45
51
|
|
46
|
-
Upon doing this, each time you start the rails server locally the data will be pushed.
|
52
|
+
Upon doing this, each time you start the rails server locally the data will be pushed. You could also use these steps if you want to manage a production instance and a development instance.
|
47
53
|
|
48
|
-
|
54
|
+
__Note: DO NOT DO THIS FOR PRODUCTION: No configuration files with sensitive information should ever be required within the application source and required config values should be read in from the ENV by supported libraries.__
|
49
55
|
|
50
56
|
Support
|
51
57
|
-------
|
52
58
|
Feel free to email us at support at sourceninja dot com if you have any questions or issues.
|
59
|
+
|
60
|
+
![sourceninja-ruby](http://cl.ly/2x001f2y042U3b05143Z/Screen%20shot%202012-03-16%20at%202.51.05%20PM.png)
|
@@ -27,6 +27,18 @@ module Sourceninja
|
|
27
27
|
return
|
28
28
|
end
|
29
29
|
|
30
|
+
# all we need in the dep list is the name of the module. the version number here won't be important because
|
31
|
+
# Bundler will resolve that into the spec list below
|
32
|
+
dep_list = {}
|
33
|
+
Bundler.environment.dependencies.to_a.map{|b| b.to_s}.each do |dep|
|
34
|
+
unless %r{^\s*(\S+)} =~ dep
|
35
|
+
Rails.logger.info "Sourceninja: Could not find the package name for #{dep.to_s}"
|
36
|
+
next
|
37
|
+
end
|
38
|
+
|
39
|
+
dep_list[$1] = true
|
40
|
+
end
|
41
|
+
|
30
42
|
package_data = []
|
31
43
|
spec_hash = Bundler.environment.specs.to_hash
|
32
44
|
spec_hash.keys.each do |key|
|
@@ -34,7 +46,7 @@ module Sourceninja
|
|
34
46
|
Rails.logger.info "Sourceninja: Could not parse information for gem #{key}: #{spec_hash[key]}"
|
35
47
|
next
|
36
48
|
end
|
37
|
-
package_data << { :package_name => key, :package_version => $1 }
|
49
|
+
package_data << { :package_name => key, :package_version => $1, :direct_requirement => (dep_list[key] || false) }
|
38
50
|
end
|
39
51
|
|
40
52
|
if package_data.empty?
|
data/lib/sourceninja/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sourceninja
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|