mkblog 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -7,7 +7,7 @@ Author:: Larry Cai (mailto:larry.caiyu@gmail.com)
7
7
  Copyright:: Copyright (c) 2012 by Larry Cai
8
8
  License:: Distributes under the Apache License 2.0, see LICENSE in the source distro
9
9
 
10
- This application will generate jekyll based blog, which is hosted in github
10
+ This application will generate {jekyll}[https://github.com/mojombo/jekyll/] based blog, which is hosted in github
11
11
 
12
12
  == Install
13
13
 
@@ -16,9 +16,23 @@ Install:
16
16
 
17
17
  == Usage
18
18
 
19
- Create new project:
20
- mkblog --generate larry # generate jekyll powered blog larry.github.com
21
- mkblog --show # list guideline
19
+ Create new project using your github id, for example you are http://github.com/sample
20
+ mkblog --generate sample # generate jekyll powered blog sample.github.com
21
+
22
+ Now you can see the blog http://localhost:4000 by running jekyll server locally
23
+ cd sample
24
+ jekyll --server
25
+
26
+ You can update the information to your personal data, to make it your own blog. I will
27
+ tune this step to be better
28
+
29
+ Create `sample.github.com` under http://github.com/sample, and follow instruction to push.
30
+
31
+ Follow the {github:pages}[http://pages.github.com/] guideline to put your own blog
32
+
33
+ If there is problem on encoding, try
34
+ export LC_CTYPE=en_US.UTF-8
35
+ export LANG=en_US.UTF-8
22
36
 
23
37
  For more help:
24
38
  mkblog --help
data/bin/mkblog CHANGED
@@ -74,8 +74,11 @@ def generate_project(project)
74
74
  if pathname.extname == '.erb'
75
75
  #puts pathname.basename.sub(/\.erb$/, '')
76
76
  #puts destination
77
- #puts File.join(destination,pathname.basename.sub(/\.erb$/, ''))
78
- File.open(File.join(destination,pathname.basename.sub(/\.erb$/, '')), 'w') do |file|
77
+ #puts relative.dirname
78
+ #puts File.join(destination,relative.dirname,pathname.basename.sub(/\.erb$/, ''))
79
+ target = File.join(destination,relative.dirname,pathname.basename.sub(/\.erb$/, ''))
80
+ print pathname.cleanpath, " => ", target,"\n"
81
+ File.open(target, 'w') do |file|
79
82
  file.puts(ERB.new(File.read(path)).result(binding))
80
83
  end
81
84
  else
@@ -1,3 +1,3 @@
1
1
  module MkBlog
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -1,24 +1,7 @@
1
- ## Larry Cai
1
+ ## Introduction
2
2
 
3
- I use the template from https://github.com/mbleigh/mbleigh.github.com, please give credits to him.
3
+ This is the person jekyll based blog hosted in github
4
4
 
5
- This is the Jekyll source for Larry Cai's blog and website, [Larry Cai](http://larrycai.github.com/). It makes some nice use of Jekyll's liquid templating system (see blog.html) and uses Javscript to pull information from GitHub for the open-source section.
6
-
7
- You may feel free to re-use any part of the structure, design, and layout of this site; it is all licensed under the MIT License. However, the content of the site (blog posts and page content) is licensed under a Creative Commons Attribution license (you may use it, but must give attribution).
8
-
9
- ## Run it locally
10
-
11
- $ jekyll --server
12
-
13
- ### Others
14
-
15
- All the blog should be encoded with UTF-8 without BOM and the environment is set as below
16
- ~~~~~ {.bash}
17
- $ cat ~/.profile
18
- LANG=en_US.UTF-8
19
- LC_ALL=en_US.UTF-8
20
- LC_CTYPE=en_US.UTF-8
21
- ~~~~~~~~~~~~
22
-
23
- ### Copyright
24
- Copyright (c) 2011 Larry Cai. Rights reserved as indicated above.
5
+ ## Acknowledge
6
+
7
+ This is the blog autogenerated by [mkblog](https://github.com/larrycai/mkblog).
@@ -0,0 +1,34 @@
1
+ ---
2
+ layout: post
3
+ title: 5分钟快速架设个人博客
4
+ ---
5
+
6
+ #介绍#
7
+ 现在很多人都有博客,为什么不自己来一个呢。最方便的是放在Github上,假设你有个Github账号`<%= project %>`
8
+
9
+ gem install mkblog
10
+ mkblog --generate <%= project %>
11
+ cd <%= project %>.github.com
12
+ jekyll --server
13
+
14
+ 好了打开浏览器访问 <http://localhost:4000> 。
15
+
16
+ 当然还没做好,你看到的是Larry Cai的东西,试着改成你自己的吧,我会用模板自动化起来,现在还是手工吧。
17
+
18
+ about.title
19
+ blog.html
20
+ index.html
21
+
22
+ 现在就可以把东西放到Github上了。在<http://github.com/<%= project %>)>建一个`<%= project %>.github.com`,然后上传。
23
+
24
+ 再在你的项目中按照[github:pages](http://pages.github.com/)配好。
25
+
26
+ 现在你就可以看到 <http://<%= project %>.github.com> 了,如果有自己的域名就可以转过来了。
27
+
28
+ 忘了说怎么写博客了,把文件放在 `_posts`即可。
29
+
30
+ # 相关阅读 #
31
+ 1. 蒋鑫的《Github权威指南》<http://www.worldhello.net/gotgithub/03-project-hosting/050-homepage.html>
32
+ 2. 展新的 “搭建 Jekyll 博客的一些小技巧” <http://www.pizn.me/2012/03/01/some-tips-for-jekyll-blog.html>
33
+ 3. 关注mkblog项目 <https://github.com/larrycai/mkblog>
34
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aruba
16
- requirement: &25610580 !ruby/object:Gem::Requirement
16
+ requirement: &25516776 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,18 @@ dependencies:
21
21
  version: 0.4.6
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *25610580
24
+ version_requirements: *25516776
25
+ - !ruby/object:Gem::Dependency
26
+ name: jekyll
27
+ requirement: &25515648 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *25515648
25
36
  description: ! 'generate jekyll based blog '
26
37
  email:
27
38
  - larry.caiyu@gmail.com
@@ -63,7 +74,7 @@ files:
63
74
  - templates/_config.yml
64
75
  - templates/_layouts/master.html
65
76
  - templates/_layouts/post.html
66
- - templates/_posts/2012-03-06-travis-ci-is-evolution.mkd
77
+ - templates/_posts/2012-03-16-setup-blog-in-5minutes.mkd.erb
67
78
  - templates/_site/about.html
68
79
  - templates/_site/atom.xml
69
80
  - templates/_site/blog.html
@@ -1,111 +0,0 @@
1
- ---
2
- layout: post
3
- title: Travis CI会替代Jenkins吗?
4
- ---
5
-
6
- #介绍#
7
- 你可能用Github了。但是你是怎么自动构建你的开源项目的呢?你的Github项目有“构建状态”标签吗?
8
-
9
- ![Github上的项目构建状态][img-building-status-tag]
10
-
11
- 如果你还不知道这个,你就有些落伍了,因为这是Travis CI带来的持续集成的革新,它可能会替代Jenkins现在的地位。
12
-
13
- 让我们一起来看看Travis-ci到底带来了什么,先从Jenkins说起。
14
-
15
- 在写这篇博客时,发现好友晓斌也写了一篇[Travis CI,翩翩而至的CI云](http://www.juvenxu.com/2012/03/06/travis-ci/),可以参考阅读。
16
-
17
- ## Jenkins介绍 ##
18
-
19
- 持续集成是敏捷软件开发的一个重要工具,开源工具[Jenkins](http://jenkins-ci.org/)是实施持续集成首选,大概占据了半壁江山。
20
-
21
- ![Jenkins界面][img-jenkins-jobs]
22
-
23
- Jenkins以前叫Hudson,后来由于Oracle收购了Sun公司,Oracle与开源软件社区谈崩了。Hudson创始人Kohsuke Kawaguchi(简称 KK)一怒之下,和社区的人其他人重起炉灶,建立了Jenkins社区。详细可以看看InfoQ的文章[Hudson社区提议将项目更名为Jenkins](http://www.infoq.com/cn/news/2011/01/hudson-jenkins2)。
24
-
25
- ### Jenkins功能 ###
26
- 它有很多极佳的特性:
27
-
28
- 1. 易于安装:一个命令就可启动,也方便部署到各种Web容器中(如tomcat)。
29
- 2. 易于配置:所有的配置都在Web界面实现,权限控制得也不错。
30
- 3. 插件支持:基本上所有的扩展都是有插件完成的,开发插件也很方便,由此产生了庞大的社区。
31
- 4. 支持分布式构建:Jenkins能够让通过主从模式(master/slave)多台机器一起构建。
32
-
33
- ### Jenkins在企业中常见步骤 ###
34
- Jenkins服务器一般先架设在一台服务器上,有配置管理人员管理。
35
-
36
- 产品有构建需求后,配置管理人员就新建一个任务,配好源码仓库,设置构建时间,指定运行脚本来编译测试产品,并且设置报告输出。一切都可以在Web界面中运行。
37
-
38
- ## Jenkins的一些弊端 ##
39
- Jenkins虽然非常好用,但还是有些弊端。
40
-
41
- ### 多平台或依赖的包 ###
42
-
43
- 如果你的软件想在不同的操作系统软件构建并验​​证,这将是相当有难度和技巧性,一般主要是准备不同的操作系统的机器,然后使用主/从模式进行分布式构建。
44
-
45
- 在C++中你可以使用有关的交叉编译器,一个不错的解决方案。
46
-
47
- 但是再进一步如果你的第三方软件和不同的依赖比较多,那么这个环境的准备是非常困难的,因为这个组合将很大。
48
-
49
- 当然你可有使用虚拟机的技术vagrant/virtualbox,参见[使用vagrant+jenkins来管理虚拟机的技巧](http://larrycai.github.com/2011/10/25/vagrant-jenkins-ci.html)。可以工作,不太优雅。因为它不是原生的,有点复杂。
50
-
51
- ### 配置管理人员的工作 ###
52
-
53
- 一般来说Jenkins的构建任务,它是集中控制的。大多来说都是有专职的配置管理人员来管理,否者权限会混乱。
54
-
55
- 当有需求时,他们负责在CI服务器创建任务(记住:这些配置文件不是有版本控制的)。这个就涉及到了沟通成本,你有变化需求,很难及时满足。
56
-
57
- 由于服务器是有限的,它主要构建重要分支的内容。在你自己的私有分支上运行CI是比较奢侈的,而且环境不一样,也不推荐。
58
-
59
- 你可以想象如果在一个C/C++产品的公司,你要为一个Lisp的项目创建CI要花多久?
60
-
61
- 作为开发者,为什么不能随时构建你想要的东西呢?这就是Travis CI想做的。
62
-
63
- ## Travis CI 介绍 ##
64
- Travis CI 这里就不介绍怎么使用了具体可以先看[晓斌的博客](http://www.juvenxu.com/2012/03/06/travis-ci/)和[免费的持续集成测试服务](http://saberma.me/other/2011/11/29/travis-ci-is-a-free-continuous-integration-test-server.html),强烈建议你先试一下。
65
-
66
- 初看Travis CI象和Jenkins没啥区别,指定你Github中的项目,然后他帮你编译,而且它使用的也是Vagrant/Virtualbox技术。但实际上里面有很多好点子。
67
-
68
- ## Travis CI带来的变革 ##
69
- ### 配置本地化和可读性 ###
70
- 不像以前,构建的任务是在Jenkins服务器上的,现在构建的配置文件直接就和源码放在一起,而且配置文件使用DSL写的,可读性更高。
71
-
72
- before_script:
73
- - sudo apt-get install pandoc
74
- - sudo apt-get install ttf-arphic-gbsn00lp ttf-arphic-ukai ttf-wqy-microhei ttf-wqy-zenhei
75
- - sudo apt-get install texlive-xetex texlive-latex-recommended texlive-latex-extra
76
- - gem install mkbok
77
-
78
- rvm:
79
- - 1.9.3
80
- - 1.8.7
81
- script: mkbok --lang zh --build pdf
82
-
83
- after_script:
84
- - which curl ; curl -v --upload-file sdcamp.zh.pdf http://blobs.ge.tt/3iBcNNC/sdcamp.zh.pdf?sig=-TY5O1GAx8xHwWiCqd8aySlQiroFAnHK2o4
85
-
86
- 作为用户,关心的是要哪些依赖包,然后怎么构建就行了,上面的配置每一行都没有浪费。
87
-
88
- ### 多版本支持 ###
89
- 像上面的例子中,我要求在两个Ruby环境中运行,它就帮我做到了,我并不关心它是怎么切换的。
90
-
91
- ![多版本构建结果][img-build-matrix]
92
-
93
- ### 原生的云技术来分布式构建 ###
94
- Travis CI使用的Ruby语言,一开始考虑的就是分布式构建,比Jenkins的插件式进了一步。
95
-
96
- 虽然Travis CI并不是直接用到了云机器,它的虚拟机部分只是Vagrant/Virtualbox,但是这一块是很容易迁移到其他的技术的。
97
-
98
- # 总结 #
99
- Jenkins有点可惜,改了名字以后,功能上面并没有突破。当然这就是开源竞争的好处,总有新的理念,新的工具产生。你不前进,别人就迎头赶上。
100
-
101
- Travis CI现在只是支持Github的公开项目,但已经爆发出它的优点了。要不了多久,我相信就能运行在你公司内部了。
102
-
103
- 让我们一起期待这个革新吧!
104
-
105
- # 相关阅读 #
106
- 1. Juven Xu的“Travis CI,翩翩而至的CI云” <http://www.juvenxu.com/2012/03/06/travis-ci/>
107
- 2. 免费的持续集成测试服务 <http://saberma.me/other/2011/11/29/travis-ci-is-a-free-continuous-integration-test-server.html>
108
-
109
- [img-jenkins-jobs]: http://larrycai.github.com//images/jenkins-jobs.jpg
110
- [img-building-status-tag]: http://larrycai.github.com/images/building-status-tag.png
111
- [img-build-matrix]: http://larrycai.github.com/images/build-matrix.png