appjam 0.1.8.pre11 → 0.1.8.pre12
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.
- data/lib/appjam/generators/gist.rb +19 -6
- data/lib/appjam/generators/gist.yml +16 -0
- data/lib/appjam/version.rb +1 -1
- metadata +4 -4
@@ -7,6 +7,15 @@ require "open-uri"
|
|
7
7
|
require 'tempfile'
|
8
8
|
require File.dirname(__FILE__) + '/jam'
|
9
9
|
|
10
|
+
class String
|
11
|
+
def is_numeric?
|
12
|
+
Float(self)
|
13
|
+
true
|
14
|
+
rescue
|
15
|
+
false
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
10
19
|
module Appjam
|
11
20
|
module Generators
|
12
21
|
class Gist < Jam
|
@@ -69,12 +78,16 @@ module Appjam
|
|
69
78
|
# Yajl::HttpStream.get(uri, :symbolize_keys => true) do |hash|
|
70
79
|
#
|
71
80
|
# end
|
72
|
-
if File.directory?("Gist/#{git_category}/#{gist_name}")
|
73
|
-
`rm -rf Gist/#{git_category}/#{gist_name}`
|
81
|
+
if File.directory?("Gist/#{git_category}/#{gist_name.downcase}")
|
82
|
+
`rm -rf Gist/#{git_category}/#{gist_name.downcase}`
|
83
|
+
end
|
84
|
+
if("#{gist_id}".is_numeric?)
|
85
|
+
`git clone git://gist.github.com/#{gist_id}.git Gist/#{git_category}/#{gist_name.downcase} && rm -rf Gist/#{git_category}/#{gist_name.downcase}/.git`
|
86
|
+
else
|
87
|
+
`git clone #{gist_id} Gist/#{git_category}/#{gist_name.downcase} && rm -rf Gist/#{git_category}/#{gist_name.downcase}/.git`
|
74
88
|
end
|
75
|
-
`git clone git://gist.github.com/#{gist_id}.git Gist/#{git_category}/#{gist_name} && rm -rf Gist/#{git_category}/#{gist_name}/.git`
|
76
89
|
if system('which qlmanage')
|
77
|
-
system("qlmanage -p Gist/#{git_category}/#{gist_name}/*.* >& /dev/null")
|
90
|
+
system("qlmanage -p Gist/#{git_category}/#{gist_name.downcase}/*.* >& /dev/null")
|
78
91
|
end
|
79
92
|
end
|
80
93
|
end
|
@@ -123,8 +136,8 @@ module Appjam
|
|
123
136
|
k.each_pair { |k1,v1|
|
124
137
|
if "#{k1}" == @gist_name
|
125
138
|
gid = k[k1][0]['id']
|
126
|
-
gname = k[k1][1]['name']
|
127
|
-
Gist::download_gist("#{gid}"
|
139
|
+
gname = k[k1][1]['name']
|
140
|
+
Gist::download_gist("#{gid}",gcategory,gname)
|
128
141
|
eval(File.read(__FILE__) =~ /^__END__/ && $' || '')
|
129
142
|
say "================================================================="
|
130
143
|
say "Your '#{gname.capitalize}' snippet code has been generated."
|
@@ -36,6 +36,18 @@ utiliy_function:
|
|
36
36
|
- id : 990157
|
37
37
|
- name : Determine_Iphone_Device
|
38
38
|
- description : Determine iPhone device info
|
39
|
+
- reachability:
|
40
|
+
- id : 994400
|
41
|
+
- name : Reachability
|
42
|
+
- description : Another way to check network availability
|
43
|
+
- hexcolor_to_uicolor:
|
44
|
+
- id : 994410
|
45
|
+
- name : Hexcolor_To_UIColor
|
46
|
+
- description : Hex color to UIColor
|
47
|
+
- category_additions:
|
48
|
+
- id : git://github.com/mkernel/iphone-snippets.git
|
49
|
+
- name : CategoryAdditions
|
50
|
+
- description : Some important category additions Base64 Keychain
|
39
51
|
|
40
52
|
snippet:
|
41
53
|
- common_macro:
|
@@ -74,5 +86,9 @@ snippet:
|
|
74
86
|
- id : 990166
|
75
87
|
- name : Stripping_HTML
|
76
88
|
- description : Stripping HTML Function
|
89
|
+
- check_if_simulator:
|
90
|
+
- id : 994426
|
91
|
+
- name : Check_If_Simulator
|
92
|
+
- description : A Macro to check if app run in Simulator
|
77
93
|
|
78
94
|
|
data/lib/appjam/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appjam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1923832033
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
9
|
- 8
|
10
10
|
- pre
|
11
|
-
-
|
12
|
-
version: 0.1.8.
|
11
|
+
- 12
|
12
|
+
version: 0.1.8.pre12
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Eiffel Q
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-05-
|
20
|
+
date: 2011-05-27 00:00:00 +08:00
|
21
21
|
default_executable: appjam
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|