Well, it is started. If you want to follow Piston 2.0’s progress, head on over to the Piston GitHub Repository.

If you want, you can register to Piston’s Recent Commits on master.

What have I got so far ?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require "piston/commands/base"

module Piston
  module Commands
    class Import < Piston::Commands::Base
      attr_reader :options

      def initialize(options={})
        @options = options
        logger.debug {"Import with options: #{options.inspect}"}
      end

      def run(revision, working_copy)
        tmpdir = working_copy.path.parent + ".#{working_copy.path.basename}.tmp"

        begin
          debug {"Creating temporary directory: #{tmpdir}"}
          tmpdir.mkdir
          revision.checkout_to(tmpdir)
          working_copy.create
          working_copy.copy_from(tmpdir)
          working_copy.remember(revision.remember_values)
          working_copy.finalize
        ensure
          debug {"Removing temporary directory: #{tmpdir}"}
          tmpdir.rmtree
        end
      end
    end
  end
end

This is the new import command. Everything is expressed in terms of high-level operations, and the different backends will take care of doing the right thing. In the case of Subversion, checking out the repository will involve running “svn checkout”. For Git, this will be “git clone”, and so on.

remember in the context above is for storing the properties Piston requires. These are the old piston:root, piston:uuid Subversion properties. The different working copy backends will take care of storing this in a format that is suitable: Subversion properties when available, YAML file otherwise.

Also, Piston will be more like Merb: it will be split in multiple Gems. Piston, the main gem, will install piston-core as well as all backends. piston-svn and piston-git are the first two backends I am planning on adding.

I’m having fun reimplementing Piston like this ! No fun no new features. Fun many new features.

 

Search

A picture of me

I am François Beausoleil, a Ruby on Rails coder. During the day, I work on XLsuite. At night, I am interested many things. Read my biography

Tags

(3) (1) (0) (2) (1) (1) (2) (2) (1) (2) (1) (2) (1) (2) (1) (1) (1) (1) (2) (14) (1) (1) (1) (1) (2) (1) (1) (2) (0) (1) (2) (1) (3) (1) (1) (1) (1) (1) (1) (0) (3) (2) (1) (2) (2) (1) (3) (2) (8) (8) (9) (12) (1) (1) (3) (1) (1) (1) (1) (1) (1) (2) (2) (2) (1) (1) (3) (1) (3) (1) (0) (21) (1) (1) (0) (1) (1) (1) (21) (23) (1) (1) (13) (1) (1) (2) (3) (1) (1) (4) (1) (2) (3) (0) (1) (7) (3) (1) (5) (5) (2) (2) (2) (4) (6) (7) (1) (0) (1) (1) (2) (2) (1) (4) (12) (2) (1) (2) (4) (1) (1) (1) (2) (8) (2) (3) (2) (2) (1) (3) (1) (1)

Links

Projects I work on

Categories

Archives